html { height: auto; min-height: 100%; }

body.admin-app-body {
  margin: 0;
  padding: 0 !important;
  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; }

.header.white-bg {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 1002;
  height: 60px;
  padding: 0 15px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.header .logo {
  float: left;
  line-height: 60px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-left: 16px;
  text-decoration: none;
}

.header-brand-row {
  float: left;
  margin-left: 16px;
  height: 60px;
  display: flex;
  align-items: center;
}

.layer-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.layer-tab {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s ease;
}

.layer-tab:hover,
.layer-tab:focus {
  color: #0f172a;
  text-decoration: none;
}

.layer-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.public-url-list {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.public-url-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.public-url-item:last-child {
  margin-bottom: 0;
}

.warn-hint {
  color: #b45309 !important;
  margin: 0 !important;
}

.top-nav { float: right; line-height: 60px; }
.top-nav .top-menu { margin: 0; padding: 0; list-style: none; }
.top-nav .top-menu > li { float: left; list-style: none; }

.header-user-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding-right: 8px;
}

.header-user-label {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  font-size: 13px;
  color: #475569;
}

.header-user-label strong { color: #0f172a; }

.header-exit-btn {
  border-radius: 8px !important;
  font-weight: 600 !important;
}

#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.sidebar-menu {
  margin: 14px 8px 20px;
  padding: 0 0 20px;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px) saturate(108%);
}

ul.sidebar-menu > li { position: relative; margin: 0 0 11px; }

ul.sidebar-menu > li + li::before {
  content: "";
  position: absolute;
  left: 12px; right: 12px; top: -4px;
  height: 8px;
  background: linear-gradient(180deg, rgba(205, 220, 239, 0) 0%, rgba(205, 220, 239, 0.5) 50%, rgba(205, 220, 239, 0) 100%);
  filter: blur(3px);
  pointer-events: none;
}

ul.sidebar-menu > li.sidebar-section-label + li::before { display: none; }

ul.sidebar-menu > li.sidebar-section-label {
  padding: 11px 12px 8px 18px;
  margin: 0 6px 2px;
  font-size: 13px;
  font-weight: 500;
  color: #4a617f;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 9px;
}

ul.sidebar-menu > li.sidebar-section-label i {
  margin-right: 8px;
  color: #7c90ac;
}

ul.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, transform 0.18s ease;
}

ul.sidebar-menu > li > a:hover,
ul.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%);
  transform: translateY(-2px);
}

ul.sidebar-menu > li > a i {
  color: #7c90ac;
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

ul.sidebar-menu > li.active > a {
  color: #1f4fa5 !important;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(82, 140, 255, 0.22) 0%, rgba(82, 140, 255, 0.12) 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(105, 153, 252, 0.28);
}

ul.sidebar-menu > li.active > a i { color: #3f73d8 !important; }

#main-content {
  margin-left: 180px;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding-bottom: 32px;
}

#main-content > .wrapper { padding: 20px 20px 40px; }

#main-content .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;
  background: #fff;
  margin-bottom: 20px;
}

#main-content .panel-heading {
  margin: 0;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
}

#main-content .panel-body { padding: 18px 20px 20px; }

.hint-text {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.65;
}

.form-group label.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.form-control {
  border-radius: 10px !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  height: 42px;
}

.form-control:focus {
  border-color: #6999fc !important;
  box-shadow: 0 0 0 3px rgba(82, 140, 255, 0.15) !important;
}

.btn-action-row { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

.btn-primary {
  border-radius: 10px !important;
  font-weight: 600 !important;
  background: linear-gradient(135deg, #4f86ff 0%, #3b6fe8 100%) !important;
  border-color: #3b6fe8 !important;
}

.btn-default {
  border-radius: 10px !important;
  font-weight: 600 !important;
}

.btn-danger-soft {
  border-radius: 8px !important;
  background: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

.alert-msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.alert-msg.ok { display: block; background: #dcfce7; color: #166534; }
.alert-msg.err { display: block; background: #fee2e2; color: #991b1b; }

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.ok { background: #dcfce7; color: #166534; }
.status-badge.no { background: #fee2e2; color: #991b1b; }

.code-inline {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
}

.cert-log {
  margin-top: 14px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  min-height: 80px;
  display: none;
}

.table-admin { margin-bottom: 0; }
.table-admin > thead > tr > th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #475569;
  font-weight: 600;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.overview-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  padding: 20px 18px;
  background: linear-gradient(168deg, #fff 0%, #f8fafc 42%, #e2e8f0 100%);
  box-shadow: 0 5px 0 rgba(203, 213, 225, 0.45), 0 8px 16px rgba(15, 23, 42, 0.08);
}

.overview-card .label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
  padding: 0;
  text-align: left;
}

.overview-card .value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}

.overview-card .value.small { font-size: 14px; font-weight: 600; }

.agent-nav-toggle {
  display: none;
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  margin: auto 0;
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.agent-nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.agent-nav-backdrop { display: none; }

@media (max-width: 991px) {
  .header.white-bg { padding-left: 52px; position: relative; }
  #main-content { margin-left: 0 !important; }
  .agent-nav-toggle { display: inline-flex !important; }
  body.admin-app-body:not(.agent-nav-open) #sidebar {
    transform: translateX(-100%);
    pointer-events: none;
  }
  body.admin-app-body.agent-nav-open #sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
  }
  .agent-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.admin-app-body.agent-nav-open .agent-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* 登录页 */
html.login-pending .login-glass-bg,
html.login-pending .login-glass-wrap { visibility: hidden; opacity: 0; }

body.login-glass {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #e8f4f0;
  background: #051a14;
}

.login-glass-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(1100px 680px at 12% 18%, rgba(16, 185, 129, 0.38) 0%, transparent 58%),
    radial-gradient(920px 600px at 88% 22%, rgba(245, 158, 11, 0.28) 0%, transparent 60%),
    linear-gradient(165deg, #051a14 0%, #0a241c 42%, #071811 100%);
}

.login-glass-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.login-glass-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 34px 32px;
  border-radius: 28px;
  background: linear-gradient(152deg, rgba(255, 255, 255, 0.18) 0%, rgba(236, 245, 255, 0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 24px 64px rgba(3, 8, 22, 0.56);
  backdrop-filter: blur(30px);
}

.login-glass-title-visual::before {
  content: "管理登录";
  display: block;
}

.login-glass-title {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 700;
  color: #f0fdf8;
  text-align: center;
}

.login-glass-sub {
  margin: 0 0 22px;
  text-align: center;
  color: #9fd9c9;
  font-size: 14px;
}

.login-glass-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(186, 205, 255, 0.24);
  background: rgba(17, 29, 54, 0.62);
  color: #eef5ff;
  box-sizing: border-box;
}

.login-glass-input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.75);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.login-glass-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #f0fdf8;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.92) 0%, rgba(5, 150, 105, 0.9) 100%);
}

.login-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  font-size: 13px;
}
