/* ============================================================
   软件安装中心-澄启科技 · 全局样式
   浅色毛玻璃 · 白多蓝少 · 全端自适应
   ============================================================ */

:root {
  --bg-1: #EFF5FF;
  --bg-2: #E2ECFB;
  --bg-3: #F6F9FF;
  --glass-bg: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.85);
  --card-bg: rgba(255, 255, 255, 0.72);
  --text-main: #1E293B;
  --text-sub: #64748B;
  --text-faint: #94A3B8;
  --primary: #3B82F6;
  --primary-soft: #60A5FA;
  --primary-deep: #2563EB;
  --primary-bg: rgba(59, 130, 246, 0.10);
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.10);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.10);
  --warning: #F59E0B;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 34px rgba(59, 130, 246, 0.10), 0 2px 10px rgba(30, 41, 59, 0.05);
  --shadow-soft: 0 6px 20px rgba(59, 130, 246, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---------- 背景毛玻璃光斑 ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.b1 { width: 480px; height: 480px; background: #BFDBFE; top: -140px; left: -100px; }
.b2 { width: 420px; height: 420px; background: #DBEAFE; bottom: -120px; right: -80px; }
.b3 { width: 300px; height: 300px; background: #E0F2FE; top: 40%; left: 55%; opacity: 0.4; }

/* ---------- 通用毛玻璃卡片 ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  border-radius: 0 0 20px 20px;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #fff; font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}
.logo-text { font-size: 17px; font-weight: 700; color: var(--text-main); letter-spacing: .5px; }

.nav { display: flex; gap: 6px; margin-left: 10px; }
.nav-link {
  padding: 8px 16px; border-radius: 999px; font-size: 14px;
  color: var(--text-sub); text-decoration: none; transition: all .2s;
}
.nav-link:hover { background: var(--primary-bg); color: var(--primary-deep); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- 主区域 ---------- */
.main {
  max-width: 1080px; margin: 0 auto; padding: 32px 20px 60px;
}

/* ---------- 按钮（胶囊） ---------- */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 24px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: all .2s ease; user-select: none; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(59, 130, 246, 0.38); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,0.7); color: var(--text-sub); border: 1px solid rgba(148, 163, 184, 0.35); }
.btn-ghost:hover { color: var(--primary-deep); border-color: var(--primary-soft); background: #fff; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; color: var(--text-sub); font-weight: 600; }
.form-hint { font-size: 12px; color: var(--text-faint); }

.input, .select, .textarea {
  width: 100%; padding: 12px 16px; font-size: 14px; color: var(--text-main);
  background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-sm); outline: none; transition: all .2s;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary-soft); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #fff;
}
.textarea { min-height: 100px; resize: vertical; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tag-on { background: var(--success-bg); color: var(--success); }
.tag-off { background: rgba(148, 163, 184, 0.15); color: var(--text-faint); }
.tag-blue { background: var(--primary-bg); color: var(--primary-deep); }

/* ---------- 卡片验证页 ---------- */
.auth-wrap {
  min-height: calc(100vh - 200px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px; padding: 36px 32px;
  border-radius: 24px; text-align: center;
}
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: #fff; font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}
.auth-title { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 26px; }

/* ---------- Flash 提示条 ---------- */
.flash-bar {
  max-width: 640px; margin: 18px auto 0; padding: 12px 20px;
  border-radius: var(--radius-sm); font-size: 14px; text-align: center;
  color: var(--primary-deep); background: var(--primary-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---------- 应用列表 ---------- */
.section-title { font-size: 18px; font-weight: 800; margin: 8px 0 18px; display: flex; align-items: center; gap: 10px; }
.section-title .count {
  font-size: 12px; font-weight: 600; color: var(--primary-deep);
  background: var(--primary-bg); padding: 2px 10px; border-radius: 999px;
}

.app-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
}
.app-card {
  padding: 22px; border-radius: var(--radius); cursor: pointer;
  transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-icon {
  width: 52px; height: 52px; border-radius: 14px; font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-bg), rgba(96, 165, 250, 0.25));
  color: var(--primary-deep);
}
.app-name { font-size: 16px; font-weight: 700; }
.app-desc {
  font-size: 13px; color: var(--text-sub); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.empty-box {
  padding: 60px 20px; text-align: center; border-radius: var(--radius);
  color: var(--text-faint); font-size: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

/* ---------- 应用详情 ---------- */
.app-detail { display: flex; flex-direction: column; gap: 22px; }
.app-detail-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.app-detail-icon {
  width: 84px; height: 84px; border-radius: 22px; font-size: 38px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-bg), rgba(96, 165, 250, 0.25));
  color: var(--primary-deep);
}
.app-detail-name { font-size: 24px; font-weight: 800; }
.app-detail-desc { font-size: 14px; color: var(--text-sub); line-height: 1.7; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.info-item {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.8);
}
.info-item .k { font-size: 12px; color: var(--text-faint); }
.info-item .v { font-size: 15px; font-weight: 700; margin-top: 2px; }

.download-zone {
  padding: 28px; text-align: center; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(96, 165, 250, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.18);
}
.download-tip { font-size: 12px; color: var(--text-faint); margin-top: 12px; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-container.toast-center { top: 18%; left: 50%; transform: translateX(-50%); align-items: center; }
.toast-container.toast-right { top: 90px; right: 18px; align-items: flex-end; }

.toast {
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #fff; box-shadow: 0 8px 24px rgba(30, 41, 59, 0.18);
  animation: toastIn .3s ease; max-width: 88vw;
}
.toast-info { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.toast-success { background: linear-gradient(135deg, #10B981, #059669); }
.toast-error { background: linear-gradient(135deg, #EF4444, #DC2626); }
.toast-center .toast { text-align: center; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast-out { animation: toastOut .3s ease forwards; }
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(30, 41, 59, 0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-box {
  width: 100%; max-width: 420px; padding: 30px 28px; border-radius: 22px; text-align: center;
  animation: toastIn .25s ease;
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--text-sub); margin-bottom: 22px; line-height: 1.7; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 表格（后台） ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(148, 163, 184, 0.18); }
.table th { font-size: 12px; color: var(--text-faint); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table td { vertical-align: middle; }
.table .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 后台 ---------- */
.admin-layout { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.admin-side { width: 220px; flex-shrink: 0; padding: 18px; border-radius: var(--radius); position: sticky; top: 90px; }
.admin-tabs { display: flex; flex-direction: column; gap: 6px; }
.admin-tab {
  display: block; padding: 11px 16px; border-radius: 12px; font-size: 14px;
  color: var(--text-sub); text-decoration: none; transition: all .2s;
}
.admin-tab:hover { background: var(--primary-bg); color: var(--primary-deep); }
.admin-tab.active { background: var(--primary-bg); color: var(--primary-deep); font-weight: 700; }
.admin-main { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 20px; }
.admin-card { padding: 24px; border-radius: var(--radius); }

.hidden-entry-hint {
  font-size: 12px; color: var(--text-faint); margin-top: 14px; text-align: center;
  font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .3px;
}

/* ---------- 版权 ---------- */
.footer { text-align: center; padding: 26px 20px 40px; font-size: 12.5px; color: var(--text-faint); }
.footer p { max-width: 1080px; margin: 0 auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .main { padding: 22px 14px 48px; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .logo-text { font-size: 15px; }
  .nav { margin-left: 0; }
  .nav-link { padding: 7px 12px; font-size: 13px; }
  .auth-card { padding: 28px 20px; }
  .app-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .admin-layout { flex-direction: column; }
  .admin-side { width: 100%; position: static; }
  .admin-tabs { flex-direction: row; flex-wrap: wrap; }
  .admin-tab { padding: 9px 14px; font-size: 13px; }
  .app-detail-head { flex-direction: column; text-align: center; }
}
@media (max-width: 440px) {
  .app-grid { grid-template-columns: 1fr; }
  .topbar-actions .tag { display: none; }
}
