* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f3;
  color: #1f2933;
}
a { color: #315fd4; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 24px;
  background: #202124;
  color: white;
  border-bottom: 3px solid #1a7f64;
}
.brand { color: white; display: grid; gap: 2px; min-width: 220px; }
.brand:hover { text-decoration: none; }
.brand-title { font-weight: 750; font-size: 18px; }
.brand-subtitle { color: #c7d1cc; font-size: 12px; font-weight: 500; }
nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav a {
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}
nav a.active,
nav a:hover {
  color: white;
  background: #33413d;
  text-decoration: none;
}
nav form { margin: 0; }
.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 0;
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 0 12px;
}
h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
.page-title p { margin: 7px 0 0; color: #647067; font-size: 14px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel {
  background: white;
  border: 1px solid #dfe5df;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.notice {
  border: 1px solid #7cb39f;
  background: #edf8f3;
  color: #17664f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 13px;
}
table { width: 100%; border-collapse: collapse; background: white; }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  min-width: var(--table-min, 980px);
  table-layout: fixed;
}
.data-table th,
.data-table td {
  overflow-wrap: anywhere;
}
.data-table .mono {
  word-break: normal;
  overflow-wrap: anywhere;
}
.data-table .nowrap,
.data-table .badge,
.data-table .status {
  overflow-wrap: normal;
}
.table-dashboard-recent { --table-min: 1280px; }
.table-dashboard-errors { --table-min: 1120px; }
.table-requests { --table-min: 2240px; }
.table-dns { --table-min: 1620px; }
.table-login-events { --table-min: 1320px; }
.table-client-rules { --table-min: 1420px; }
.table-tasks { --table-min: 1280px; }
.table-official { --table-min: 1780px; }
.table-uploads { --table-min: 1520px; }
.table-generated { --table-min: 1640px; }
.table-icons { --table-min: 1520px; }
col.col-id { width: 64px; }
col.col-time { width: 118px; }
col.col-time-stack { width: 220px; }
col.col-type { width: 126px; }
col.col-user { width: 150px; }
col.col-ip { width: 146px; }
col.col-host { width: 220px; }
col.col-path { width: 430px; }
col.col-owner { width: 125px; }
col.col-mode { width: 155px; }
col.col-status { width: 95px; }
col.col-size { width: 125px; }
col.col-detail { width: 360px; }
col.col-error { width: 220px; }
col.col-agent { width: 390px; }
col.col-actions { width: 390px; }
col.col-app { width: 215px; }
col.col-resource { width: 340px; }
col.col-hash { width: 180px; }
col.col-replacement { width: 380px; }
col.col-task { width: 280px; }
col.col-target { width: 140px; }
col.col-duration { width: 90px; }
col.col-answer { width: 480px; }
col.col-raw { width: 310px; }
col.col-file { width: 260px; }
col.col-signing { width: 310px; }
col.col-icon { width: 120px; }
th, td {
  border-bottom: 1px solid #e5e9e3;
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.45;
}
th {
  background: #f0f3ef;
  color: #34403a;
  font-weight: 700;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
button,
.primary-link {
  border: 1px solid #b9c4bd;
  background: white;
  color: #1f2933;
  padding: 7px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
}
button:hover,
.primary-link:hover {
  background: #f2f5f1;
  text-decoration: none;
}
button:disabled,
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
button.ghost {
  background: transparent;
  color: #e5e7eb;
  border-color: #59625d;
}
button.ghost:hover { background: #33413d; }
button.danger {
  border-color: #e3a09a;
  background: #fff7f6;
  color: #9f1c13;
}
button.danger:hover { background: #fff0ee; }
input, select, textarea {
  border: 1px solid #b9c4bd;
  border-radius: 6px;
  padding: 8px 9px;
  background: white;
}
textarea {
  min-height: 120px;
  resize: vertical;
  font: inherit;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stats div {
  background: white;
  border: 1px solid #dfe5df;
  border-left: 4px solid #1a7f64;
  padding: 16px;
  border-radius: 8px;
}
.stats strong { display: block; font-size: 28px; line-height: 1; }
.stats span { display: block; margin-top: 8px; color: #647067; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.small { font-size: 12px; }
.muted { color: #6b756e; font-size: 12px; }
.nowrap { white-space: nowrap; }
.error { color: #b42318; }
.empty { text-align: center; color: #647067; padding: 28px 12px; }
.request-ip {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.request-path {
  display: -webkit-box;
  max-height: 2.9em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #ccd5cf;
  background: #f6f8f5;
  color: #31413a;
  font-size: 12px;
  white-space: nowrap;
}
.badge.strong { border-color: #7cb39f; background: #edf8f3; color: #17664f; }
.status.ok { border-color: #7cb39f; background: #edf8f3; color: #17664f; }
.status.warn { border-color: #d8b56c; background: #fff7e3; color: #855800; }
.status.bad { border-color: #e3a09a; background: #fff0ee; color: #b42318; }
.actions { min-width: 360px; }
.actions.compact { min-width: 160px; }
.actions > .primary-link {
  display: inline-flex;
  margin-bottom: 8px;
}
.actions form { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.actions form:last-child { margin-bottom: 0; }
.actions select { min-width: 210px; max-width: 260px; }
.check-field { align-self: stretch; }
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: #25342e;
  font-size: 13px;
}
.check-row input[type="checkbox"] {
  width: auto;
  min-width: 16px;
}
.icon-preview {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 4px solid #1a7f64;
  border-radius: 14px;
  background: #e4f7ed;
  color: #17231e;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}
.icon-preview span { display: block; font-size: 18px; }
.replacement-summary {
  display: grid;
  gap: 6px;
  align-items: start;
}
.replacement-detail {
  min-width: 220px;
  max-width: 320px;
  margin-top: 7px;
  display: grid;
  gap: 3px;
}
.replacement-detail .status { margin-top: 3px; }
.login {
  max-width: 420px;
  margin: 80px auto;
  background: white;
  border: 1px solid #dfe5df;
  padding: 26px;
  border-radius: 8px;
}
.login h1 { margin-bottom: 8px; }
.login form { display: grid; gap: 14px; margin-top: 18px; }
.login label { display: grid; gap: 6px; font-size: 14px; }
.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.upload-panel h2 { margin-bottom: 6px; }
.package-bindings {
  display: grid;
  gap: 9px;
  max-width: 720px;
  margin-top: 14px;
}
.package-bindings label {
  font-size: 12px;
  color: #647067;
}
.package-bindings button { justify-self: start; }
.rule-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.rule-form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #647067;
}
.rule-form input,
.rule-form select { width: 100%; }
.rule-form .form-actions { display: flex; align-items: end; }
.activation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: stretch;
}
.activation-main .lead { color: #496257; line-height: 1.6; }
.activation-form {
  display: flex;
  gap: 10px;
  margin: 18px 0 12px;
}
.activation-form input {
  max-width: 180px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 800;
  text-align: center;
}
.notice {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0;
}
.notice.ok { background: #e8f7ef; color: #12643c; }
.notice.warn { background: #fff1df; color: #8a4a04; }
.support-note { color: #5e6d66; line-height: 1.65; }
.sponsor-box {
  border: 1px solid #d8e6df;
  border-radius: 18px;
  padding: 16px;
  background: #f7fbf8;
  text-align: center;
}
.sponsor-box h2 { margin: 12px 0 6px; font-size: 18px; }
.sponsor-box p { color: #5e6d66; line-height: 1.55; }
.qr-box {
  width: 150px;
  height: 150px;
  margin: 0 auto;
  border-radius: 16px;
  background:
    linear-gradient(90deg, #1b6f56 12px, transparent 12px) 0 0/28px 28px,
    linear-gradient(#1b6f56 12px, transparent 12px) 0 0/28px 28px,
    #fff;
  border: 10px solid #fff;
  box-shadow: inset 0 0 0 1px #c6d6cf, 0 10px 28px rgba(24, 77, 58, 0.14);
  display: grid;
  place-items: center;
}
.qr-box span {
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  color: #164f3f;
}
@media (max-width: 720px) {
  .activation-card { grid-template-columns: 1fr; }
  .activation-form { flex-direction: column; }
  .activation-form input { max-width: none; }
}
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filters.wide {
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(130px, 1fr));
}
.filters label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #647067;
}
.filters input,
.filters select { width: 100%; }
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 1px;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.pagination span {
  color: #647067;
  font-size: 13px;
}
.base-apk-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.base-apk-grid > div {
  border: 1px solid #e5e9e3;
  border-radius: 8px;
  padding: 12px;
  min-height: 92px;
}
pre { white-space: pre-wrap; max-width: 420px; margin: 0; font-size: 11px; color: #38443d; }
.request-detail { min-width: 360px; max-width: 620px; }
.request-detail details { margin-bottom: 8px; }
.request-detail details:last-child { margin-bottom: 0; }
.request-detail summary {
  cursor: pointer;
  color: #17664f;
  font-weight: 650;
}
.request-detail pre {
  max-width: 580px;
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #e0e6df;
  border-radius: 6px;
  background: #fbfcfa;
}
.task-detail { min-width: 260px; max-width: 620px; }
.task-detail details { margin-top: 6px; }
.task-detail summary {
  cursor: pointer;
  color: #17664f;
  font-weight: 650;
}
.task-detail pre {
  max-width: 580px;
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #e0e6df;
  border-radius: 6px;
  background: #fbfcfa;
}
.check-page { min-height: 100vh; display: grid; place-items: center; background: #f5f6f3; }
.check-card { background: white; border: 1px solid #b6d8c9; border-radius: 8px; padding: 28px; min-width: 360px; }
.check-card h1 { color: #17664f; margin-bottom: 18px; }
.check-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.check-card dt { color: #647067; }
.check-card dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  nav { justify-content: flex-start; }
  .page { padding: 16px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .base-apk-grid { grid-template-columns: 1fr; }
  .filters,
  .filters.wide { grid-template-columns: 1fr; }
  .filter-actions,
  .pagination { justify-content: flex-start; }
  .panel { overflow-x: auto; }
  .actions { min-width: 300px; }
}
