/* 7BOX admin enhancements: rotation stats, i18n, tables */

.page-head {
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 0;
  font-size: 0.95rem;
}

.card-search {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 18px;
  align-items: end;
}
.search-grid .form-row {
  margin: 0;
}
.search-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data-table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
table.data-table tbody tr:hover {
  background: #f8fafc;
}
table.data-table th.num,
table.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cell-ellipsis {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-cell {
  text-align: center;
  padding: 28px !important;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-rate {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.badge-rate-lg {
  font-size: 1.1rem;
  padding: 6px 14px;
}
.badge-ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.stat-card.highlight {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
}
.stat-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
}
.kv-table th {
  text-align: left;
  width: 200px;
  font-weight: 600;
  padding: 0.45rem 0.75rem 0.45rem 0;
  vertical-align: top;
  color: #64748b;
  font-size: 0.88rem;
}
.kv-table td {
  padding: 0.45rem 0;
  word-break: break-all;
  font-size: 0.9rem;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.back-link {
  margin: 0 0 8px;
  font-size: 0.9rem;
}
.task-link {
  font-weight: 600;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  padding: 4px 10px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.82rem;
}
.lang-btn {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}
.lang-btn:hover {
  color: var(--accent);
  text-decoration: none;
}
.lang-btn.active {
  color: var(--accent);
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.lang-sep {
  color: #cbd5e1;
  user-select: none;
}
.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a.active {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid #6366f1;
  padding-left: 17px;
  color: #fff;
  font-weight: 600;
}
.metrics-note { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.45; max-width: 52rem; }
.metric-hint { cursor: help; opacity: 0.65; font-size: 0.85em; margin-left: 0.15em; }
.metric-hint:hover { opacity: 1; }

/* 统一分页栏 */
.pagination-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pagination-bar.pagination-bar-top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  align-items: flex-end;
  text-align: right;
  gap: 8px;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
}
.list-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  min-width: 0;
}
.list-toolbar-paging {
  flex: 1 1 360px;
  min-width: 280px;
  max-width: 100%;
}
.list-toolbar-paging-only {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
}
.pagination-bar-top .pagination-nav,
.pagination-bar-top .pagination-size,
.pagination-bar-top .pagination-jump {
  justify-content: flex-end;
}

/* 短链列表页：合并创建表单 */
.create-link-card {
  margin-bottom: 16px;
}
.create-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.create-link-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.domain-showcase-inline {
  margin-bottom: 14px;
}
.domain-showcase-inline .muted {
  margin: 0 0 8px;
  font-size: 0.86rem;
}

/* 点击统计搜索 */
.analytics-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 1 1 320px;
  max-width: 100%;
}
.analytics-search-form input[type="search"] {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 320px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

/* 紧凑页头：标题 + 时区 + 横向分页（点击统计） */
.page-shell-compact {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-shell-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}
.page-shell-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  min-width: 0;
  flex: 1 1 280px;
}
.page-shell-title h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.25;
}
.page-shell-title .muted {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}
.page-shell-tz {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
  font-size: 0.88rem;
}
.page-shell-row-paging {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.pagination-bar-compact {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  align-content: center;
  gap: 8px 14px;
  width: 100%;
  text-align: left;
}
.pagination-bar-compact .pagination-summary {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pagination-bar-compact .pagination-nav,
.pagination-bar-compact .pagination-size,
.pagination-bar-compact .pagination-jump {
  flex: 0 1 auto;
  justify-content: flex-start;
}
.pagination-bar-compact .pagination-jump {
  margin-left: auto;
}
@media (max-width: 900px) {
  .pagination-bar-compact .pagination-jump {
    margin-left: 0;
    width: 100%;
  }
}

/* 表格固定表头（点击统计等长列表） */
.table-sticky-card {
  padding: 0;
  overflow: hidden;
}
.analytics-table-card .table-sticky-wrap {
  max-height: calc(100vh - 168px);
}
.analytics-shell + .analytics-table-card {
  margin-top: 12px;
}
.table-sticky-wrap {
  overflow: auto;
  max-height: min(calc(100vh - 280px), 75vh);
}
.table-sticky-head {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
.table-sticky-head th,
.table-sticky-head td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  background: #fff;
}
.table-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #4b5563;
  font-weight: 600;
  background: #fafafa;
  box-shadow: 0 1px 0 var(--border);
}
.table-sticky-head tbody tr:hover td {
  background: #fafafa;
}
.table-sticky-head .nowrap {
  white-space: nowrap;
}

.pagination-summary {
  font-size: 0.88rem;
}
.pagination-nav,
.pagination-size,
.pagination-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pagination-jump-input {
  width: 4.5rem !important;
  max-width: 4.5rem !important;
  padding: 5px 8px !important;
  text-align: center;
}
.btn.disabled,
.btn.btn-sm.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.pagination-current {
  min-width: 2rem;
  text-align: center;
}
