/* ============================================================
   琨耀科技官网 · 应用扩展样式
   登录 / 开发者中心 / 账户管理后台
   ============================================================ */

/* ---------- 认证状态按钮（导航） ---------- */
.nav-user-area { display: flex; align-items: center; gap: 10px; }
.nav-auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 18px; font-size: 14px; font-weight: 700;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: var(--grad-brand); color: #fff; transition: transform .2s, box-shadow .2s;
}
.nav-auth-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.nav-auth-btn.ghost { background: transparent; color: var(--brand-blue); border-color: var(--brand-blue); }
.nav-user-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px;
  border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.nav-user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.nav-user-chip .admin-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 20px;
  background: var(--grad-red); color: #fff; font-weight: 700;
}
.nav-logout {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 6px; font-weight: 600;
}
.nav-logout:hover { color: var(--brand-red); }

/* ---------- 认证页（登录 / 注册） ---------- */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid; grid-template-columns: 1fr 1fr;
}
.auth-visual {
  position: relative; overflow: hidden; padding: clamp(40px, 6vw, 80px);
  background: var(--grad-hero); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5;
}
.auth-visual-glow {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,123,255,.5), transparent 70%);
  top: -100px; right: -120px;
}
.auth-visual-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-visual-inner .eyebrow { color: #7fb0ff; }
.auth-visual-inner h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.25; margin: 0 0 20px; font-weight: 800; }
.auth-visual-inner p { color: #a9bcd6; font-size: 16px; margin: 0 0 32px; }
.auth-point { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.auth-point .ico {
  flex: 0 0 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.auth-point strong { display: block; font-size: 16px; margin-bottom: 2px; }
.auth-point span { color: #a9bcd6; font-size: 14px; }
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(40px, 6vw, 80px) clamp(20px, 5vw, 60px);
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card-head { margin-bottom: 30px; }
.auth-card-head h1 { font-size: 30px; margin: 0 0 8px; font-weight: 800; }
.auth-card-head p { color: var(--muted); margin: 0; }
.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 28px;
  background: var(--bg-soft); border-radius: 12px;
}
.auth-tab {
  flex: 1; padding: 11px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 15px;
  transition: all .2s;
}
.auth-tab.active { background: #fff; color: var(--brand-blue); box-shadow: var(--shadow-sm); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }
.field input {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; color: var(--ink); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(27,83,216,.1); }
.field-hint { font-size: 12px; color: var(--muted-light); margin-top: 6px; }
.auth-submit {
  width: 100%; height: 50px; margin-top: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--grad-brand); color: #fff; font-size: 16px; font-weight: 700;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.auth-msg { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 14px; display: none; }
.auth-msg.show { display: block; }
.auth-msg.err { background: #fef2f2; color: #b31420; border: 1px solid #fecaca; }
.auth-msg.ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.auth-demo-hint {
  margin-top: 24px; padding: 14px 16px; border-radius: 10px;
  background: var(--bg-soft); border: 1px dashed var(--line);
  font-size: 13px; color: var(--muted); line-height: 1.8;
}
.auth-demo-hint code { background: #fff; padding: 1px 6px; border-radius: 4px; color: var(--brand-blue); font-weight: 700; }

/* ---------- 开发者中心 ---------- */
.dev-hero {
  background: var(--grad-hero); color: #fff; padding-block: clamp(50px, 7vw, 84px);
  position: relative; overflow: hidden;
}
.dev-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 24px 24px;
}
.dev-hero .container { position: relative; z-index: 1; }
.dev-hero h1 { font-size: clamp(30px, 4.6vw, 50px); margin: 0 0 16px; font-weight: 800; }
.dev-hero p { color: #a9bcd6; font-size: clamp(15px, 1.6vw, 18px); max-width: 720px; margin: 0 0 28px; }
.dev-version-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.dev-version-badges span {
  padding: 7px 14px; border-radius: 30px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
}
.sdk-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.sdk-card-top {
  padding: clamp(26px, 4vw, 40px);
  background: linear-gradient(135deg, #f8fbff, #eef4ff);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.sdk-title-wrap { display: flex; align-items: center; gap: 20px; }
.sdk-icon {
  width: 68px; height: 68px; border-radius: 16px; flex: 0 0 68px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  box-shadow: 0 8px 20px rgba(27,83,216,.25);
}
.sdk-card-top h2 { margin: 0 0 6px; font-size: clamp(21px, 2.6vw, 28px); font-weight: 800; }
.sdk-card-top .sdk-meta { color: var(--muted); font-size: 14px; }
.sdk-card-body { padding: clamp(26px, 4vw, 40px); }
.sdk-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 32px; }
.sdk-feature {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px;
  border-radius: var(--radius-sm); background: var(--bg-soft);
}
.sdk-feature .tick { color: var(--brand-green); font-weight: 900; font-size: 18px; line-height: 1.3; }
.sdk-feature strong { display: block; font-size: 15px; margin-bottom: 2px; }
.sdk-feature p { margin: 0; font-size: 13px; color: var(--muted); }
.sdk-info-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; font-size: 14px; }
.sdk-info-table td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sdk-info-table td:first-child { color: var(--muted); width: 160px; }
.sdk-info-table td:last-child { font-weight: 600; color: var(--ink); }
.code-block {
  background: var(--bg-ink); color: #a9bcd6; border-radius: var(--radius-sm);
  padding: 20px 22px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px; line-height: 1.8; overflow-x: auto; margin: 0 0 28px;
}
.code-block .k { color: #7fb0ff; }
.code-block .s { color: #67e8b0; }
.code-block .c { color: #64748b; }
.sdk-download-area {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.sdk-download-area .dl-note { font-size: 13px; color: var(--muted); }
.sdk-download-area .dl-note strong { color: var(--ink); }
.btn-dl {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 11px; cursor: pointer;
  background: var(--grad-red); color: #fff; font-size: 16px; font-weight: 700;
  transition: transform .2s, box-shadow .2s;
}
.btn-dl:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(216,30,44,.3); }
.btn-dl.locked { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.gate-notice {
  display: none; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius-sm);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; margin-bottom: 24px;
}
.gate-notice.show { display: flex; }
.gate-notice p { margin: 0; flex: 1; font-size: 14px; }
.gate-notice a { color: var(--brand-blue); font-weight: 700; text-decoration: underline; }

/* ---------- 管理后台 ---------- */
.admin-page { background: var(--bg-soft); min-height: calc(100vh - var(--nav-h)); padding-block: clamp(30px, 5vw, 54px); }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-head h1 { font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 6px; font-weight: 800; }
.admin-head p { color: var(--muted); margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.admin-stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.admin-stat .n { font-size: 32px; font-weight: 800; color: var(--brand-blue); line-height: 1; margin-bottom: 8px; }
.admin-stat .l { font-size: 13px; color: var(--muted); }
.admin-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.admin-search { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-search input, .admin-search select {
  height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 9px;
  font-size: 14px; color: var(--ink); background: #fff;
}
.admin-search input { min-width: 220px; }
.admin-search input:focus, .admin-search select:focus { outline: none; border-color: var(--brand-blue); }
.btn-add {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px;
  border: 0; border-radius: 9px; cursor: pointer; background: var(--grad-brand); color: #fff;
  font-weight: 700; font-size: 14px;
}
.btn-add:hover { box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.data-table th {
  text-align: left; padding: 14px 20px; background: var(--bg-soft);
  font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap;
}
.data-table td { padding: 15px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tr:hover td { background: #fafcff; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.user-cell strong { display: block; font-size: 14px; }
.user-cell small { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.admin { background: #fef2f2; color: #b31420; }
.badge.user { background: #eef4ff; color: var(--brand-blue); }
.badge.active { background: #f0fdf4; color: #15803d; }
.badge.disabled { background: #f1f5f9; color: #64748b; }
.row-actions { display: flex; gap: 8px; }
.row-actions button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 6px 11px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.row-actions button:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.row-actions button.danger:hover { border-color: var(--brand-red); color: var(--brand-red); }
.admin-empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pagination-btns { display: flex; gap: 6px; }
.pagination-btns button {
  min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
.pagination-btns button:hover:not(:disabled) { border-color: var(--brand-blue); color: var(--brand-blue); }
.pagination-btns button:disabled { opacity: .4; cursor: not-allowed; }
.pagination-btns button.current { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(10,20,36,.6); backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-close { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--brand-red); }
.modal-body { padding: 28px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 28px 28px; }
.modal-foot button {
  min-height: 44px; padding: 0 22px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.btn-cancel { border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); }
.btn-confirm { border: 0; background: var(--grad-brand); color: #fff; }
.btn-confirm.danger { background: var(--grad-red); }
.modal-msg { margin-top: 14px; font-size: 13px; display: none; }
.modal-msg.show { display: block; }
.modal-msg.err { color: #b31420; }
.admin-gate { text-align: center; padding: 100px 20px; }
.admin-gate h2 { font-size: 26px; margin: 0 0 12px; }
.admin-gate p { color: var(--muted); margin: 0 0 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .nav-cta { display: none !important; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: 320px; padding: 40px 24px; }
  .auth-visual-inner p, .auth-point { display: none; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .sdk-feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .sdk-card-top { flex-direction: column; align-items: flex-start; }
  .sdk-download-area { flex-direction: column; align-items: stretch; }
  .btn-dl { justify-content: center; }
}
