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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.page-header {
  background: #fff;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #eee;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: #1677ff;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.subtitle {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

.hint {
  font-size: 12px;
  color: #1677ff;
  margin-top: 10px;
}

.filter-btn {
  background: none;
  border: none;
  color: #333;
  padding: 8px;
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.list {
  padding: 12px 16px 24px;
}

.loading, .empty, .state-msg {
  text-align: center;
  padding: 40px;
  color: #999;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-id {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.platform {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.platform.qq { background: #12b7f5; }
.platform.wechat { background: #07c160; }

.id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.level {
  font-weight: 600;
  font-size: 14px;
}

.account-id {
  font-size: 13px;
  color: #333;
  font-family: monospace;
}

.copy-sm {
  font-size: 12px;
  color: #1677ff;
  background: #e8f3ff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
}

.login-time {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.rank-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #b8860b;
  font-weight: 600;
  white-space: nowrap;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-box {
  background: #f5f6f8;
  border-radius: 10px;
  padding: 10px 12px;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
}

.stat-value.coin { color: #d48806; }

.attr-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.attr-tag {
  font-size: 12px;
  color: #1677ff;
  border: 1px solid #91caff;
  background: #e6f4ff;
  border-radius: 4px;
  padding: 2px 8px;
}

.detail-box {
  background: #f5f6f8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 10px;
}

.extra-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.extra-tag {
  font-size: 12px;
  background: #fff7e6;
  color: #d48806;
  border: 1px solid #ffd591;
  border-radius: 4px;
  padding: 2px 8px;
}

.copy-btn {
  width: 100%;
  padding: 12px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:active { opacity: 0.85; }

/* Filter panel */
.filter-panel {
  flex: 1;
  min-height: 0;
  padding: 8px 16px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.filter-handle {
  width: 36px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.filter-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.clear-link {
  background: none;
  border: none;
  color: #1677ff;
  font-size: 13px;
  cursor: pointer;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.chip {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  max-width: 100%;
}

.chip.sm {
  padding: 6px 10px;
  font-size: 12px;
  text-align: left;
  white-space: normal;
  word-break: break-all;
  line-height: 1.4;
}

.chip.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #f5f6f8;
}

.filter-footer {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.btn-reset {
  flex: 0 0 100px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #f0f0f0;
  color: #1677ff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-apply {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* 弹层 & Toast */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.filter-drawer {
  width: 100%;
  max-height: 88vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 200;
  pointer-events: none;
}
