* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Custom rounded tap feedback */
*:active {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.sticky-header {
  position: relative;
  top: 0;
  z-index: 20;
  background: white;
  box-shadow: none;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 68px 20px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-brand {
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 10px;
  opacity: 0.5;
  color: white;
  z-index: 5;
}

/* Decorative dynamic light orbs */
.header::before,
.header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  animation: floatBlob 6s ease-in-out infinite;
  pointer-events: none;
}

.header::before {
  top: -60px;
  right: -40px;
  animation-delay: 0s;
}

.header::after {
  bottom: -80px;
  left: -30px;
  width: 200px;
  height: 140px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation-delay: -3s;
}

.header-light {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.header-light-1 {
  top: 20%;
  left: 10%;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  animation: floatBlob 8s ease-in-out infinite;
  animation-delay: -1s;
}

.header-light-2 {
  top: 50%;
  right: 15%;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  animation: floatBlob 7s ease-in-out infinite;
  animation-delay: -5s;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -15px) scale(1.1); }
  66% { transform: translate(-10px, 10px) scale(0.9); }
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}

.header-top h1 {
  font-size: 28px;
  letter-spacing: 2px;
  margin-bottom: 0;
  font-weight: 800;
  text-align: center;
  position: relative;
  z-index: 1;
  color: white;
}

.header-avatar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.avatar-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(200,200,200,0.55);
  background: rgba(200,200,200,0.2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.avatar-btn:hover {
  background: rgba(255,255,255,0.25);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.avatar-btn:active {
  transform: scale(0.88);
  background: rgba(255,255,255,0.45);
}

.avatar-btn svg {
  width: 16px;
  height: 16px;
}

.header-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.header-btn:active {
  background: rgba(255,255,255,0.3);
  transform: scale(0.95);
}

.center-title {
  text-align: center;
  width: 100%;
}

.header h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 15px;
  opacity: 0.85;
}

.expiry-timer {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 8px;
}

.login-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}



.filter-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: white;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.filter-btn:active {
  transform: scale(0.95);
}

/* Search + export in one row */
.search-export-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 10px;
  background: white;
}

.search-export-row .search-bar {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.search-export-row .export-btn {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid #10b981;
  background: #10b981;
  font-size: 13px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.search-export-row .export-btn:active {
  transform: scale(0.95);
  background: #059669;
}

.search-bar {
  padding: 6px 20px 12px;
  background: white;
}

.search-bar input {
  width: 100%;
  padding: 8px 40px 8px 38px;
  border-radius: 24px;
  border: 1px solid #e8e8e8;
  font-size: 14px;
  outline: none;
  transition: all 0.25s;
  background: #f5f5f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") 14px center no-repeat;
}

.search-bar input::placeholder {
  color: #bbb;
  font-size: 13px;
}

.search-bar input:focus {
  border-color: #667eea;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.app-card {
  min-width: 0;
  background: white;
  border-radius: 14px;
  padding: 10px 8px 8px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}

.app-card:active {
  transform: scale(0.96);
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  font-weight: bold;
  border: 1px solid #f5c842;
}

.app-icon-img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin: 0 auto 6px;
  overflow: hidden;
  border: 1px solid #f5c842;
}

.app-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-icon-img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid #f5c842;
}

.app-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-category {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.app-rating {
  font-size: 13px;
  color: #f5a623;
}

.card-edit-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.app-card:hover .card-edit-btn,
.app-card:active .card-edit-btn {
  opacity: 1;
}

/* Detail modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(255,255,255,0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 24px;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  font-size: 16px;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.close-btn:active {
  background: rgba(0,0,0,0.1);
  color: #888;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: white;
  flex-shrink: 0;
  border: 1px solid #f5c842;
}

.detail-info h2 {
  font-size: 22px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.detail-info .detail-category {
  font-size: 14px;
  color: #999;
}

.detail-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.detail-meta-item {
  text-align: center;
}

.detail-meta-item .label {
  font-size: 12px;
  color: #999;
}

.detail-meta-item .value {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 36px;
  margin-bottom: 10px;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 999px;
  text-align: center;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.2s;
}

.download-btn:active {
  opacity: 0.8;
}

.feedback-box {
  margin-top: 18px;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 16px;
}

.feedback-toggle {
  width: 100%;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-form {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 12px;
  background: rgba(255,251,235,0.72);
}

.feedback-form.active {
  display: block;
}

.feedback-grid label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
}

.feedback-grid input,
.feedback-grid textarea,
.feedback-grid select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}

.feedback-grid textarea {
  min-height: 64px;
  resize: vertical;
}

.feedback-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}

.feedback-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.feedback-submit,
.feedback-apply,
.feedback-ignore {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-submit,
.feedback-apply {
  background: #f59e0b;
  color: #fff;
}

.submit-app-entry {
  border-color: #f59e0b !important;
  color: #b45309 !important;
  background: #fffbeb !important;
}

.submit-app-modal {
  max-width: 560px !important;
}

.feedback-ignore {
  background: #f3f4f6;
  color: #6b7280;
}

.feedback-admin-modal {
  max-width: 640px !important;
}

.feedback-empty {
  padding: 24px 0;
  text-align: center;
  color: #888;
}

.feedback-card {
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.78);
  margin-bottom: 12px;
}

.feedback-card-head,
.feedback-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.feedback-app-name {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

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

.feedback-pill {
  flex-shrink: 0;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
}

.feedback-values {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.feedback-value {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.feedback-value span {
  color: #888;
}

.feedback-value strong {
  color: #333;
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .feedback-row {
    grid-template-columns: 1fr;
  }

  .feedback-card-head,
  .feedback-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-card-actions button {
    width: 100%;
  }
}

.download-btn.harmonyos {
  background: linear-gradient(135deg, #007AFF, #5856D6);
}

.download-btn.harmonyos.disabled {
  background: #aaa;
  cursor: not-allowed;
  opacity: 0.6;
}

.download-btn.wps {
  background: linear-gradient(135deg, #007AFF, #5856D6);
}

.download-btn.alipan {
  background: #1677ff;
}

.download-btn.direct {
  background: #333;
}

.download-btn.other {
  background: #667eea;
}

.dl-icon {
  font-size: 18px;
}

/* Share card */
.share-card {
  background: linear-gradient(145deg, #667eea, #764ba2);
  border-radius: 20px;
  padding: 24px;
  color: white;
  margin-top: 8px;
}

.share-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.share-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(255,255,255,0.2);
}

.share-card-name {
  font-size: 14px;
  font-weight: 700;
}

.share-card-desc {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 16px;
  line-height: 1.5;
}

.share-card-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.share-card-qr img, .share-card-qr canvas {
  border-radius: 12px;
  background: white;
  padding: 8px;
}

.share-card-footer {
  text-align: center;
  font-size: 12px;
  opacity: 0.7;
}

.share-hint {
  font-size: 13px;
  color: #667eea;
  text-align: center;
  margin-top: 16px;
  padding: 10px;
  background: #f0f0ff;
  border-radius: 10px;
}

/* Status filter */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 0;
  background: linear-gradient(90deg, #667eea, #764ba2);
  font-size: 13px;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

.notice-bar-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dc2626;
  color: white;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  animation: labelSwing 1.5s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes labelSwing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.notice-bar:active {
  opacity: 0.85;
}

.notice-bar-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.notice-bar-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1;
  padding-top: 1px;
}

.notice-bar-close {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.2s;
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 0;
  background: linear-gradient(90deg, #667eea, #764ba2);
  font-size: 13px;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

.notice-bar-close:active {
  background: rgba(255,255,255,0.4);
}

#noticeModal.modal {
  align-items: center;
}

.welcome-modal-content {
  border-radius: 24px;
  text-align: center;
}

@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

#welcomeModal.modal {
  align-items: center;
}

.welcome-modal-content {
  max-width: 360px !important;
  padding: 40px 32px 32px !important;
  animation: quickPop 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.welcome-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.welcome-modal-icon {
  width: 88px;
  height: 88px;
  border-radius: 18px;
}

.welcome-modal-texts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
}

.welcome-modal-desc {
  font-size: 14px;
  color: #777;
  line-height: 1.5;
}

.welcome-modal-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.2s;
}

.welcome-modal-btn:active {
  opacity: 0.8;
}

.welcome-modal-skip {
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  padding: 4px 12px;
  cursor: pointer;
}

/* ===== Notice Modal Redesigned ===== */
#noticeModal.modal {
  align-items: center;
}

/* ===== Notice Modal ===== */
.notice-modal-content {
  text-align: center;
  position: relative;
  padding: 0 !important;
  border-radius: 24px !important;
  max-width: 360px !important;
  overflow: hidden;
  animation: quickPop 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

@keyframes slideUpIn {
  0% { opacity: 1; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes quickPop {
  0% { opacity: 0; transform: scale(0.75); }
  60% { opacity: 1; transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes noticeModalIn {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.notice-modal-top-row {
  display: flex;
  justify-content: flex-end;
  padding: 14px 14px 0;
}

.notice-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 36px 0;
}

.notice-modal-header-icon {
  font-size: 28px;
  line-height: 1;
}

.notice-modal-header-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.notice-modal-body {
  padding: 22px 36px 24px;
}

.notice-modal-text {
  font-size: 16px;
  color: #333;
  line-height: 1.9;
  text-align: justify;
  margin: 0;
  padding: 0;
}

.notice-modal-footer {
  display: flex;
  justify-content: center;
  padding: 0 32px 28px;
}

.notice-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  width: auto;
  text-decoration: none;
}

.notice-modal-btn:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.notice-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  font-size: 16px;
  color: #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.notice-modal-close:active {
  background: rgba(0,0,0,0.1);
  color: #888;
}

/* ===== Export Modal ===== */
#exportModal.modal {
  align-items: center;
}

.export-modal-content {
  text-align: center;
  max-width: 360px !important;
  border-radius: 24px !important;
  padding: 28px 24px 20px !important;
  animation: quickPop 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.export-modal-top-row {
  display: flex;
  justify-content: flex-end;
  height: 0;
}

.export-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin: 20px 0 16px;
}

#detailModal .modal-content {
  padding-top: 48px;
  animation: slideUp 0.25s ease;
}

/* Detail modal exit - slide down (no fade) */
#detailModal.closing {
  overflow: hidden;
}

#detailModal.closing .modal-content {
  animation: slideDownExit 0.2s ease-in both;
}

@keyframes slideDownExit {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

.export-option-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 16px 16px;
  margin: 10px 0;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.export-option-btn:active {
  transform: scale(0.97);
  background: #f5f5ff;
  border-color: #667eea;
}

.export-option-btn span:last-child {
  margin-left: auto;
}

.notice-modal-close:active {
  background: rgba(0,0,0,0.1);
  color: #888;
}

.filter-row {
  padding: 4px 16px 4px;
  background: white;
  position: relative;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.filter-all-wrapper {
  position: relative;
  display: inline-flex;
}

.filter-group .filter-btn.active#filterAllBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: none;
  border-radius: 999px;
}

#filterAllBtn {
  position: relative;
  padding-right: 16px !important;
}

#filterAllBtn::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 3.5px;
  height: 3.5px;
  border: solid #999;
  border-width: 0 1.2px 1.2px 0;
  transition: transform 0.2s;
}

#filterAllBtn.active::after {
  border-color: white;
}

#filterAllBtn.dropdown-open::after {
  transform: translateY(-50%) rotate(-135deg);
}

#filterAllBtn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: none;
  border-radius: 999px;
}

.category-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 130px;
  max-height: 260px;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 50;
  padding: 6px 0;
}

.category-dropdown.open {
  display: block;
}

.category-dropdown-item {
  padding: 9px 12px 9px 16px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-dropdown-item:hover {
  background: #f5f5f5;
}

.category-dropdown-item.selected {
  color: #f97316;
  font-weight: 600;
  background: #fff7ed;
}

.category-dropdown-item .cat-count {
  background: #f0f0f0;
  color: #888;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 10px;
  line-height: 1.5;
}

.category-dropdown-item.selected .cat-count {
  background: #fde6c8;
  color: #f97316;
}

.filter-group .filter-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: white;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px #ddd;
}

.filter-group .filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: none;
  border-radius: 999px;
}

.filter-group .filter-btn:active {
  transform: scale(0.95);
}



/* Status badge on cards */
.app-card {
  position: relative;
}

.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 2;
}

.testing-badge {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fcd34d;
}

.launched-badge {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #86efac;
}

.new-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  z-index: 2;
  overflow: hidden;
  box-shadow: none;
}




  text-align: center;
  padding: 24px 0 12px;
}

.tool-btn {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 14px;
  white-space: nowrap;
  border-radius: 12px;
  border: 2px dashed #667eea;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: #667eea;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:active {
  transform: scale(0.96);
  background: #f0f0ff;
}

.sync-notification {
  text-align: center;
  padding: 10px 20px;
  margin: 0 20px;
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-radius: 10px;
  color: #16a34a;
  font-size: 14px;
  font-weight: 500;
}

/* Edit form */
.edit-form {
  max-height: 85vh;
  overflow-y: auto;
}

.edit-form h2 {
  margin-bottom: 16px;
  font-size: 22px;
}

.edit-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-top: 12px;
  margin-bottom: 4px;
}

.edit-form input,
.edit-form textarea,
.edit-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 15px;
  box-sizing: border-box;
  font-family: inherit;
}

.edit-form textarea {
  min-height: 60px;
  resize: vertical;
}

.edit-form input[type="color"] {
  padding: 0;
  border: 0;
  height: 44px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}

.edit-form input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.edit-form input[type="color"]::-webkit-color-swatch {
  border: 1px solid #ddd;
  border-radius: 7px;
}

.edit-row .edit-field-sm {
  flex: 1 1 80px;
  min-width: 60px;
}

/* Edit row layout */
.edit-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.edit-row .edit-field {
  flex: 1;
}

.edit-row .edit-field-sm {
  flex: 0 0 80px;
}

.edit-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-top: 12px;
  margin-bottom: 4px;
  text-align: left;
}

/* Edit modal center save button */
.edit-footer {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.edit-footer .btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 60px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.edit-footer .btn-save:active {
  opacity: 0.8;
  transform: scale(0.96);
}

/* iOS-style switch buttons */
#editModal .switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

#editModal .switch-label input {
  display: none;
}

#editModal .switch-slider {
  position: relative;
  width: 44px;
  height: 26px;
  background: #d0d0d0;
  border-radius: 26px;
  transition: background 0.25s;
  flex-shrink: 0;
}

#editModal .switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#editModal .switch-label input:checked + .switch-slider {
  background: #667eea;
}

#editModal .switch-label input:checked + .switch-slider::after {
  transform: translateX(18px);
}

#editModal .switch-text {
  font-size: 14px;
  color: #444;
  font-weight: 500;
}

/* Edit/Login modal slide up animation */
#editModal .edit-form,
#loginModal .edit-form {
  animation: slideUp 0.25s ease;
}

#editModal.closing,
#loginModal.closing {
  overflow: hidden;
}

#editModal.closing .edit-form,
#loginModal.closing .edit-form {
  animation: slideDownExit 0.2s ease-in both;
}

.form-actions {
  display: flex;
  gap: 12px;
  
}

.form-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.form-actions button:active {
  opacity: 0.8;
}

.btn-save {
  background: #667eea;
  color: white;
}

.btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.export-toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px 6px;
}

.export-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #d0d0d0;
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.export-btn:active {
  transform: scale(0.95);
  background: #f5f5f5;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px 20px;
  font-size: 13px;
  color: #999;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 14px;
  font-weight: 400;
  color: #bbb;
  letter-spacing: 1px;
}

.footer-avatar {
  display: flex;
  align-items: center;
  gap: 0;
}

.footer-avatar .avatar-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.footer-avatar .avatar-btn:active {
  background: #e8e8e8;
}

.footer-tagline {
  color: #bbb;
  font-size: 12px;
  margin: 0;
}
.loading {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
}

/* Scroll to top button */
.scroll-top-btn {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(102,126,234,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(102,126,234,0.3);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:active {
  transform: translateX(-50%) scale(0.85);
}

.scroll-top-btn svg {
  width: 22px;
  height: 22px;
}

/* Responsive */
@media (min-width: 600px) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .modal-content {
    border-radius: 24px;
    margin: auto;
    max-height: 80vh;
  }
}


/* ===== Login Modal Redesign ===== */
#loginModal.modal {
  align-items: center;
}

#loginModal .modal-content {
  border-radius: 24px;
  max-width: 380px;
  width: 90%;
  animation: quickPop 0.35s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

#loginModal .edit-form {
  max-width: 380px;
  margin: 0 auto;
}

#loginModal .edit-form h2 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 20px;
  margin-top: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#loginForm label {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-top: 16px;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#loginForm input {
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.25s;
  background: #fafafa;
  outline: none;
}

#loginForm input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

#loginForm input::placeholder {
  color: #bbb;
  font-size: 14px;
}

.login-submit {
  position: relative;
  overflow: hidden;
  width: 160px;
  padding: 10px 0;
  margin: 0 auto;
  display: block;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(102,126,234,0.4);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.login-submit .btn-text {
  position: relative;
  z-index: 1;
}

.login-submit .btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

#loginForm .login-error {
  color: #dc2626;
  font-size: 14px;
  margin-top: 16px;
  display: none;
  text-align: center;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
  font-weight: 500;
}


/* Get button on app cards */
.app-card .get-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px 16px 4px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
  letter-spacing: 1px;
}

.app-card .get-btn.active {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: white;
}

.app-card .get-btn.active:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.app-card .get-btn.disabled {
  background: #e0e0e0;
  color: #bbb;
  cursor: not-allowed;
}


/* ===== Recommended Section ===== */
.recommended-section {
  padding: 16px 16px 6px;
  background: white;
}

.recommended-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rec-label {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.rec-hint {
  font-size: 11px;
  color: #bbb;
  font-weight: 500;
}

.recommended-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 20px 18px;
  scrollbar-width: none;
}

.recommended-scroll > * {
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recommended-scroll::-webkit-scrollbar {
  display: none;
}

.rec-item {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  background: white;
  border-radius: 16px;
  border: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  position: relative;
}

.rec-item:active {
  transform: scale(0.92);
}

.rec-item-hot {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 14px;
  line-height: 1;
  z-index: 3;
  display: none;
  pointer-events: none;
}

.rec-item.enlarged .rec-item-hot {
  display: block;
}

.rec-item-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  font-weight: bold;
  border: 1px solid #f5c842;
}

.rec-item-img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  margin: 0 auto 4px;
  overflow: hidden;
  border: 1px solid #f5c842;
}

.rec-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-item-name {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  line-height: 1.2;
  text-align: center;
  max-width: 108px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
