/* APK分发后台：参考「代理加密前」顶栏+侧栏+白卡片主区，独立文件、非复制整库 */

html {
  height: auto;
  min-height: 100%;
}

body.apk-app-body {
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: #334155;
  background: linear-gradient(165deg, #eef1fb 0%, #f4f6fd 40%, #f8fafc 100%);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

#container {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* 顶栏 */
.apk-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1002;
  height: 60px;
  padding: 0 15px;
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.apk-logo {
  float: left;
  line-height: 60px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-left: 8px;
  text-decoration: none;
}

.apk-logo:hover {
  color: #2563eb;
  text-decoration: none;
}

.apk-top-nav {
  float: right;
  line-height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
}

.apk-user-pill {
  display: inline-block;
  padding: 4px 10px;
  line-height: 1.35;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  font-size: 13px;
  color: #475569;
}

.apk-user-pill strong {
  color: #0f172a;
}

/* 侧栏 */
.apk-sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  width: 180px;
  z-index: 1001;
  overflow-x: hidden;
  overflow-y: auto;
  background: radial-gradient(120% 75% at 0 0, rgba(255, 255, 255, 0.88) 0%, rgba(244, 249, 255, 0.68) 56%, rgba(234, 242, 252, 0.45) 100%),
    linear-gradient(180deg, #f4f8fd 0%, #edf3fb 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 4px 0 16px rgba(15, 23, 42, 0.05);
}

ul.apk-sidebar-menu {
  margin: 14px 8px 0;
  padding: 0 0 20px;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
  backdrop-filter: blur(14px) saturate(108%);
}

ul.apk-sidebar-menu > li {
  margin: 0 0 8px;
}

ul.apk-sidebar-menu > li.apk-sidebar-label {
  padding: 11px 12px 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #4a617f;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  margin: 0 6px 10px;
}

ul.apk-sidebar-menu > li.apk-sidebar-label i {
  margin-right: 8px;
  color: #7c90ac;
}

ul.apk-sidebar-menu > li > a {
  display: block;
  margin: 0 6px;
  padding: 11px 12px;
  font-size: 14px;
  color: #546a88;
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.18s ease, color 0.18s ease;
}

ul.apk-sidebar-menu > li > a:hover,
ul.apk-sidebar-menu > li > a:focus {
  color: #27456f;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, rgba(242, 248, 255, 0.88) 100%);
  text-decoration: none;
}

ul.apk-sidebar-menu > li > a i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  color: #7c90ac;
}

ul.apk-sidebar-menu > li.active > a {
  color: #1f4fa5;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(82, 140, 255, 0.22) 0%, rgba(82, 140, 255, 0.12) 100%);
  box-shadow: inset 0 0 0 1px rgba(105, 153, 252, 0.28);
}

ul.apk-sidebar-menu > li.active > a i {
  color: #3f73d8;
}

/* 主区：每个菜单单独页面，内容从主区顶部开始 */
#main-content.apk-main {
  margin-left: 180px;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding-bottom: 32px;
  position: relative;
  box-sizing: border-box;
  background: linear-gradient(165deg, #eef1fb 0%, #f4f6fd 40%, #f8fafc 100%);
}

#main-content.apk-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 42% at 4% 8%, rgba(99, 102, 241, 0.08) 0%, transparent 52%),
    radial-gradient(ellipse 48% 36% at 96% 12%, rgba(56, 189, 248, 0.06) 0%, transparent 48%);
}

#main-content.apk-main > .wrapper {
  position: relative;
  z-index: 1;
  padding: 20px 20px 40px;
}

.apk-panel.panel {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.apk-panel .panel-heading {
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.apk-panel .panel-body {
  padding: 18px 20px 20px;
}

.apk-breadcrumb-bar {
  margin-bottom: 16px;
  font-size: 13px;
  color: #64748b;
}

.apk-breadcrumb-bar strong {
  color: #0f172a;
  font-weight: 600;
}

.apk-drop-zone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.apk-drop-zone .apk-drop-label {
  display: block;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

.apk-file-input-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.apk-drop-zone:hover,
.apk-drop-zone.apk-drag {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.apk-drop-zone .apk-drop-icon {
  font-size: 42px;
  color: #94a3b8;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

@media (max-width: 767px) {
  .apk-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
  }
  #main-content.apk-main {
    margin-left: 0;
  }
}

/* 用户管理 · 修改密码弹窗（HTML dialog） */
#apk-pwd-modal {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  max-width: 92vw;
  width: 400px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18);
}
#apk-pwd-modal::backdrop {
  background: rgba(15, 23, 42, 0.35);
}
.apk-dialog-head {
  padding: 16px 18px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}
.apk-dialog-body {
  padding: 18px 18px 8px;
}
.apk-dialog-foot {
  padding: 12px 18px 16px;
  text-align: right;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
#apk-pwd-modal-err {
  margin: 8px 0 0;
  font-size: 13px;
}

/* 文件列表页 · 上传进度与卡片 */
.apk-upload-progress {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}


.apk-upload-files-panel .apk-file-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0;
  padding-bottom: 8px;
}

.apk-upload-files-panel .apk-file-card-col {
  flex: 0 0 auto;
  width: 168px;
  height: 168px;
  max-width: min(168px, 100%);
  padding: 0;
  box-sizing: border-box;
}

.apk-upload-files-panel .apk-file-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 28px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.apk-upload-files-panel .apk-file-card:hover {
  border-color: #cbd5e1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 4px 8px rgba(15, 23, 42, 0.07),
    0 14px 36px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.apk-upload-files-panel .apk-file-card-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 4px;
  word-break: break-all;
  text-align: center;
  width: 100%;
  max-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.apk-upload-files-panel .apk-file-card-meta {
  font-size: 10px;
  line-height: 1.3;
  flex: 1 1 auto;
  margin-bottom: 6px;
  min-height: 0;
  overflow: hidden;
  text-align: center;
  width: 100%;
}

.apk-upload-files-panel .apk-file-card-actions {
  flex-shrink: 0;
}

.apk-upload-files-panel .apk-file-card-btn-row {
  display: flex;
  gap: 6px;
}

.apk-upload-files-panel .apk-file-card-btn-row .btn {
  flex: 1;
  min-width: 0;
  padding: 4px 4px;
  font-size: 11px;
  line-height: 1.2;
}

.apk-upload-files-panel .panel-body {
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(241, 245, 249, 0.75) 0%, rgba(248, 250, 252, 0.35) 42%, transparent 72%);
}

.apk-file-cards-msg {
  margin: 0 0 14px;
  font-size: 13px;
  min-height: 20px;
}

.apk-file-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 16px 14px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 28px rgba(15, 23, 42, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.apk-file-card:hover {
  border-color: #cbd5e1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9) inset,
    0 4px 8px rgba(15, 23, 42, 0.07),
    0 14px 36px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.apk-file-card-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 8px;
  word-break: break-all;
  max-height: 3.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.apk-file-card-meta {
  font-size: 12px;
  line-height: 1.45;
  flex: 1 1 auto;
  margin-bottom: 10px;
}

.apk-file-card-actions {
  flex-shrink: 0;
}

/* 首页 · 双卡片概览（两列等高） */
.apk-home-cards {
  margin-left: -10px;
  margin-right: -10px;
}

@media (min-width: 768px) {
  .apk-home-cards.row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .apk-home-cards.row::before,
  .apk-home-cards.row::after {
    display: none;
  }
  .apk-home-cards.row > .apk-home-card-col {
    float: none;
    flex: 0 0 50%;
    max-width: 50%;
    width: 50%;
    display: flex;
  }
}

.apk-home-card-col {
  padding-left: 10px;
  padding-right: 10px;
}

.apk-home-stat-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  padding: 18px 20px 16px;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #fff 0%, #fafbfc 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  margin-bottom: 16px;
}

.apk-home-stat-disk .apk-home-progress {
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .apk-home-cards .apk-home-card-col:last-child .apk-home-stat-card {
    margin-bottom: 0;
  }
}

.apk-home-stat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.apk-home-stat-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #3b82f6;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.06));
}

.apk-home-stat-disk .apk-home-stat-icon {
  color: #0ea5e9;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0.06));
}

.apk-home-stat-db .apk-home-stat-icon {
  color: #6366f1;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.06));
}

.apk-home-stat-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.apk-home-stat-desc {
  font-size: 13px;
  line-height: 1.55;
}

.apk-home-progress {
  margin-top: 14px;
  margin-bottom: 0;
  height: 10px;
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
}

.apk-home-progress .progress-bar {
  box-shadow: none;
  min-height: 100%;
}

.apk-home-stat-metric {
  margin-top: 4px;
  min-height: 48px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.apk-home-stat-number {
  font-size: 36px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.apk-home-stat-unit {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}

.apk-home-stat-foot {
  margin: 0;
  padding-top: 12px;
  margin-top: 14px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.apk-home-stat-db .apk-home-stat-foot {
  margin-top: auto;
  padding-top: 12px;
}

.apk-home-stat-link {
  font-size: 13px;
  font-weight: 500;
  color: #2563eb;
  text-decoration: none;
}

.apk-home-stat-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.apk-home-stat-link .fa {
  margin-left: 2px;
}

/* 表单输入黑色文字 */
.apk-app-body .form-control {
  color: #0f172a;
}
.apk-app-body .form-control::placeholder {
  color: #94a3b8;
}

/* 下载链接复制行 */
.apk-dl-link-row {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}
.apk-dl-link-row input.form-control {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}
.apk-dl-link-row .btn {
  flex-shrink: 0;
}

/* 登录页 */
body.apk-login-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(165deg, #eef1fb 0%, #f4f6fd 40%, #f8fafc 100%);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.apk-login-wrap {
  width: 100%;
  max-width: 400px;
}
.apk-login-brand {
  text-align: center;
  margin-bottom: 24px;
}
.apk-login-brand h1 {
  margin: 12px 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}
.apk-login-brand p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}
.apk-login-mark {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}
.apk-login-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(15, 23, 42, 0.08);
}
.apk-login-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}
.apk-login-sub {
  margin: 0 0 18px;
  font-size: 12px;
  color: #64748b;
}
.apk-login-field {
  display: block;
  margin-bottom: 14px;
}
.apk-login-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #475569;
}
.apk-login-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
.apk-login-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.apk-login-btn {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  cursor: pointer;
}
.apk-login-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.apk-login-err {
  margin: 12px 0 0;
  font-size: 13px;
  color: #dc2626;
}
.apk-login-err[hidden] {
  display: none;
}
