/* ===== CSS Variables & Reset ===== */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fafafa;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: #e8f2ff;
  --danger: #ff3b30;
  --danger-light: #fff0f0;
  --success: #34c759;
  --warning: #ff9500;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-width: 260px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'Helvetica Neue', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 14px;
}

input, textarea, select {
  font-family: inherit;
  font-size: 15px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 980px;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #e03028;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== Cards ===== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ===== Frontend Layout ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, #0a84ff 0%, #5856d6 50%, #af52de 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow:
    0 4px 12px rgba(0, 113, 227, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.admin-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 48px;
  text-align: center;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 21px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Search */
.search-container {
  max-width: 600px;
  margin: 40px auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  border: 1px solid var(--border-light);
  border-radius: 980px;
  background: var(--bg-primary);
  font-size: 17px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light), var(--shadow-md);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 18px;
}

/* Categories */
.categories-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-bar::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 980px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
}

.category-chip:hover {
  border-color: var(--border);
  color: var(--text-primary);
}

.category-chip.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.category-chip .chip-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-chip .chip-icon svg {
  width: 15px;
  height: 15px;
}

/* App Grid */
.apps-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px 80px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .title-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 980px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-light);
}

.app-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: transparent;
  color: inherit;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

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

.app-meta {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-category {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-category svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.app-featured-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  background: #f1f1ff;
  color: #4445c7;
  border-radius: 980px;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.app-featured-badge svg {
  width: 10px;
  height: 10px;
}

.app-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.app-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-url {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.app-open {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ===== Admin Layout ===== */
.admin-body {
  background: var(--bg-secondary);
  min-height: 100vh;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 8px 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item .nav-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 980px;
}

.nav-item.active .nav-badge {
  background: rgba(0, 113, 227, 0.15);
  color: var(--accent);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-footer a:hover {
  background: var(--bg-secondary);
}

#sidebarLogout {
  display: none;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb .separator {
  color: var(--text-tertiary);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-content {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
  color: var(--success);
  font-weight: 500;
}

/* Table */
.table-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.table-search input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  outline: none;
  transition: all var(--transition);
}

.table-search input:focus {
  background: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.table-search .search-icon {
  left: 12px;
  font-size: 14px;
}

.table-filter {
  display: flex;
  gap: 8px;
}

.filter-select {
  padding: 9px 32px 9px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-tertiary);
}

.table-app-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

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

.table-app-icon svg {
  width: 18px;
  height: 18px;
}

.app-icon svg {
  width: 24px;
  height: 24px;
}

.card svg {
  width: 26px;
  height: 26px;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.table-app-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.table-app-url {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
}

.badge-featured {
  background: #fff5e6;
  color: #b45309;
}

.badge-normal {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 4px;
}

.table-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.table-empty .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 0 28px 24px;
}

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 5px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--border);
  border-radius: 980px;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--success);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #eef2ff 0%, #f0f4ff 25%, #f5f5f7 50%, #eef4ff 75%, #e8ecff 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before,
.login-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}

.login-container::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.15), transparent 70%);
  top: -100px;
  right: -80px;
}

.login-container::after {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(88, 86, 214, 0.12), transparent 70%);
  bottom: -80px;
  left: -60px;
}

.login-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 28px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 20px 60px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(145deg, #0a84ff 0%, #5856d6 50%, #af52de 100%);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 22px;
  box-shadow:
    0 8px 24px rgba(0, 113, 227, 0.25),
    0 2px 8px rgba(88, 86, 214, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  position: relative;
}

.login-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 50%);
  pointer-events: none;
}

.login-logo svg {
  width: 36px;
  height: 36px;
  position: relative;
  z-index: 1;
}

.login-card h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-card > p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.login-card .btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
  transition: all 0.2s ease;
}

.login-card .btn:hover {
  background: linear-gradient(180deg, #0090ff 0%, #0077ed 100%);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}

.login-card .btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.login-card .form-input {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--border-light);
  transition: all 0.2s ease;
}

.login-card .form-input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}

.login-error.show {
  display: block;
}

.back-home {
  margin-top: 24px;
  font-size: 14px;
}

.back-home a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.back-home a:hover {
  color: var(--accent);
}

/* Settings */
.settings-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 20px;
}

.settings-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

/* Confirm Dialog */
.confirm-content {
  text-align: center;
  padding: 8px 0;
}

.confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.confirm-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Drag & Drop Sorting */
.drag-handle {
  cursor: grab;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.drag-handle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.drag-handle:active {
  cursor: grabbing;
}

.data-table tr.dragging {
  opacity: 0.4;
  background: var(--accent-light);
}

.data-table tr.drag-over {
  position: relative;
}

.data-table tr.drag-over td {
  background: var(--accent-light);
  border-top: 2px solid var(--accent);
}

.sort-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 10px;
}

.sort-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sort-btn {
  width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition);
  padding: 0;
}

.sort-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--accent);
}

.sort-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.sort-btn svg {
  width: 14px;
  height: 14px;
}

th.sort-col {
  width: 50px;
  text-align: center;
}

td.sort-col {
  text-align: center;
  padding: 8px;
}

.sort-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================
   Responsive Design
   Device CSS widths:
   - iPad Pro 12.9" / Air 13": 1024 × 1366
   - iPad Pro 11": 834 × 1194
   - iPad Air 11": 820 × 1180
   - iPad 10th gen: 820 × 1166
   - iPad mini: 744 × 1133
   - Standard iPad: 768 × 1024

   Breakpoints:
   - Large tablet / small laptop: <= 1366px
   - iPad Pro portrait / Air landscape: <= 1024px
   - iPad standard portrait / mini: <= 834px
   - Large phone / small tablet: <= 768px
   - Phone: <= 480px
   ======================================== */

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
  display: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 49;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ===== Large iPad landscape / small laptop (1025-1366px) ===== */
@media (max-width: 1366px) {
  .hero h1 { font-size: 48px; }
  .hero p { font-size: 20px; }

  .header-inner,
  .apps-section,
  .categories-bar,
  .hero {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 28px;
    padding-right: 28px;
  }

  .page-content {
    max-width: 1000px;
  }
}

/* ===== iPad Pro 12.9" portrait / iPad Air landscape (835-1024px) ===== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  .hero h1 { font-size: 42px; }
  .hero p { font-size: 18px; }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
  }

  .header-inner,
  .apps-section,
  .categories-bar,
  .hero {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Admin: compact but keep sidebar visible */
  .page-content { padding: 24px; }
  .topbar { padding: 0 24px; }
  .sidebar-nav { padding: 10px; }
  .nav-item { padding: 9px 10px; font-size: 14px; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Keep dashboard 2-column on iPad Pro portrait */
  .dash-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px;
  }

  .table-app-url { max-width: 180px; }

  .settings-card { padding: 24px; }
}

/* ===== iPad standard portrait / iPad mini (769-834px) ===== */
@media (max-width: 834px) {
  :root {
    --sidebar-width: 280px;
  }

  /* Sidebar becomes drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 51;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  #logoutBtn { display: none; }
  #sidebarLogout { display: flex; }

  /* Frontend */
  .hero { padding: 36px 20px 24px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 17px; }

  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .header-inner,
  .apps-section,
  .categories-bar {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Admin */
  .page-content { padding: 20px; }
  .topbar { padding: 0 20px; height: 60px; }
  .breadcrumb { font-size: 14px; }

  .dash-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 12px; }

  .table-app-url { max-width: 220px; }
}

/* ===== Large phone / small tablet landscape (481-768px) ===== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  /* --- Frontend --- */
  .hero {
    padding: 40px 20px 28px;
  }
  .hero h1 {
    font-size: 32px;
    letter-spacing: -0.02em;
  }
  .hero p {
    font-size: 16px;
  }

  .search-container {
    margin-top: 28px;
  }
  .search-input {
    padding: 13px 20px 13px 46px;
    font-size: 16px;
  }

  .header-inner {
    height: 56px;
    padding: 0 16px;
  }
  .logo { font-size: 18px; }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 8px;
  }
  .admin-link {
    padding: 6px 12px;
    font-size: 12px;
  }
  .admin-link svg { width: 14px; height: 14px; }

  .categories-bar {
    padding: 0 16px 16px;
    gap: 6px;
  }
  .category-chip {
    padding: 7px 14px;
    font-size: 13px;
  }

  .apps-section {
    padding: 12px 16px 48px;
  }
  .section-title {
    font-size: 22px;
    margin-bottom: 16px;
  }
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .app-card {
    padding: 16px;
    border-radius: 14px;
  }
  .app-card-header {
    gap: 10px;
    margin-bottom: 10px;
  }
  .app-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 20px;
  }
  .app-name { font-size: 15px; }
  .app-category { font-size: 11px; }
  .app-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  .app-card-footer {
    margin-top: 12px;
    padding-top: 10px;
  }
  .app-url { font-size: 11px; }
  .app-open { font-size: 12px; }
  .app-featured-badge {
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 2px 6px;
  }

  .site-footer {
    padding: 24px 16px;
    font-size: 12px;
  }

  /* --- Admin --- */
  .topbar {
    height: 56px;
    padding: 0 16px;
  }
  .breadcrumb { font-size: 13px; }
  .topbar-actions .btn-primary {
    padding: 8px 14px;
    font-size: 13px;
  }
  .topbar-actions .btn-primary svg {
    width: 12px;
    height: 12px;
  }

  .page-content { padding: 20px 16px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 14px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 16px;
    border-radius: 12px;
  }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 12px; }

  .dash-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Table -> Card layout */
  .table-card { border-radius: 14px; }
  .table-toolbar {
    padding: 12px 14px;
    gap: 10px;
  }
  .table-search {
    max-width: none;
    width: 100%;
  }
  .table-filter {
    width: 100%;
    justify-content: space-between;
  }
  .filter-select {
    flex: 1;
    font-size: 14px;
  }

  .data-table thead { display: none; }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
  }
  .data-table tr:last-child { border-bottom: none; }
  .data-table td {
    padding: 4px 0;
    border: none;
    text-align: left;
  }
  .data-table td.sort-col {
    position: absolute;
    top: 14px;
    right: 12px;
    padding: 0;
    width: auto;
  }
  .data-table td.sort-col .drag-handle { display: none; }
  .data-table td:nth-child(2) { padding-right: 80px; }

  .data-table td:nth-child(3),
  .data-table td:nth-child(4) {
    display: inline-block;
    width: auto;
    margin-right: 8px;
    margin-top: 8px;
  }
  .data-table td:nth-child(5) {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
  }
  .action-buttons {
    justify-content: flex-start;
    gap: 2px;
  }
  .action-buttons .btn-icon {
    width: 40px;
    height: 40px;
  }

  .sort-cell {
    flex-direction: column;
    gap: 0;
  }
  .sort-btn {
    width: 28px;
    height: 22px;
  }

  .table-app-url { max-width: none; }

  .settings-card {
    padding: 20px;
    border-radius: 14px;
  }
  .settings-card h3 { font-size: 16px; }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px;
    padding: 12px 14px;
  }

  .modal {
    border-radius: 20px;
    max-height: 92vh;
  }
  .modal-header { padding: 20px 20px 12px; }
  .modal-title { font-size: 19px; }
  .modal-body { padding: 0 20px 16px; }
  .modal-footer { padding: 12px 20px 20px; }
  .modal-footer .btn {
    flex: 1;
    padding: 12px;
  }

  .login-card {
    padding: 36px 28px;
    border-radius: 20px;
  }
  .login-logo {
    width: 56px;
    height: 56px;
    font-size: 26px;
    border-radius: 16px;
  }
  .login-card h1 { font-size: 22px; }

  .apps-grid[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sort-hint { display: none; }
}

/* ===== Phone (<= 480px) ===== */
@media (max-width: 480px) {
  .hero {
    padding: 32px 16px 24px;
  }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .app-card { padding: 14px; }
  .app-icon {
    width: 40px;
    height: 40px;
  }

  .section-title { font-size: 20px; }

  .stats-grid { grid-template-columns: 1fr; }

  .data-table tr { padding: 12px 14px; }

  .page-title { font-size: 22px; }

  .topbar-actions .btn-primary {
    padding: 7px 12px;
    font-size: 12px;
  }

  .apps-grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .login-card { padding: 32px 22px; }

  .modal-overlay { padding: 12px; }
}

/* ===== Touch device optimizations ===== */
@media (hover: none) and (pointer: coarse) {
  .app-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  .app-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
  .btn-primary:hover { transform: none; }
  .btn-primary:active { transform: scale(0.97); }
  .category-chip:hover { border-color: var(--border-light); }
  .category-chip:active { background: var(--bg-secondary); }
  .btn-icon {
    width: 40px;
    height: 40px;
  }
  .nav-item {
    padding: 12px;
    font-size: 15px;
  }
}

/* ===== iPad Pro 12.9" portrait specific (1024px) ===== */
@media (min-width: 835px) and (max-width: 1024px) and (orientation: portrait) {
  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== iPad landscape large (1194-1366px) ===== */
@media (min-width: 1194px) and (max-width: 1366px) and (orientation: landscape) {
  .apps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .page-content {
    max-width: 1100px;
  }
}

/* ===== Safe area for notched devices ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
  .sidebar-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .modal-footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

@supports (padding-top: env(safe-area-inset-top)) {
  .topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(64px + env(safe-area-inset-top));
  }
  .sidebar-header {
    padding-top: calc(24px + env(safe-area-inset-top));
  }
}

/* ===== Print styles ===== */
@media print {
  .site-header,
  .sidebar,
  .topbar,
  .admin-link,
  .app-card-footer,
  .action-buttons,
  .sort-col {
    display: none !important;
  }
  .main-content { margin-left: 0; }
  body { background: #fff; }
}

/* ===== Frontend Visual System 2026 ===== */
.frontend-body {
  --front-bg: #ffffff;
  --front-surface: #ffffff;
  --front-ink: #101322;
  --front-muted: #667085;
  --front-subtle: #98a2b3;
  --front-line: #e7e9f0;
  --front-accent: #5b5ce2;
  --front-accent-deep: #4445c7;
  --front-accent-soft: #eeefff;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -260px, rgba(91, 92, 226, 0.1), transparent 500px),
    var(--front-bg);
  color: var(--front-ink);
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

.frontend-body .site-header {
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(232, 233, 241, 0.88);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.frontend-body .header-inner {
  max-width: 1180px;
  height: 72px;
  padding: 0 24px;
}

.frontend-body .logo {
  gap: 11px;
  color: var(--front-ink);
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.frontend-body .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #6869ec, #4a4bd1);
  box-shadow: 0 7px 18px rgba(91, 92, 226, 0.25);
}

.frontend-body .logo-icon::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
}

.frontend-body .admin-link {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--front-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--front-muted);
  font-size: 13px;
  font-weight: 560;
  box-shadow: 0 1px 2px rgba(16, 19, 34, 0.03);
}

.frontend-body .admin-link:hover {
  background: #fff;
  border-color: #d9dce7;
  color: var(--front-ink);
  box-shadow: 0 6px 18px rgba(16, 19, 34, 0.07);
}

.frontend-body .hero {
  position: relative;
  max-width: 1180px;
  min-height: 430px;
  margin: 24px auto 30px;
  padding: 72px 32px 58px;
  overflow: hidden;
  border: 1px solid rgba(224, 226, 238, 0.9);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(242, 243, 255, 0.94), #ffffff 50%, rgba(241, 247, 255, 0.92));
  box-shadow:
    0 1px 2px rgba(16, 19, 34, 0.03),
    0 24px 70px rgba(31, 36, 66, 0.07);
}

.frontend-body .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(91, 92, 226, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 92, 226, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 82%);
  pointer-events: none;
}

.frontend-body .hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}

.frontend-body .hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.frontend-body .hero-glow-one {
  top: -150px;
  right: -110px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(91, 92, 226, 0.2), transparent 70%);
}

.frontend-body .hero-glow-two {
  bottom: -180px;
  left: -120px;
  width: 390px;
  height: 390px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.14), transparent 70%);
}

.frontend-body .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 22px;
  padding: 5px 12px 5px 7px;
  border: 1px solid rgba(91, 92, 226, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--front-accent-deep);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 18px rgba(91, 92, 226, 0.07);
}

.frontend-body .hero-kicker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--front-accent-soft);
}

.frontend-body .hero-kicker-icon svg {
  width: 12px;
  height: 12px;
}

.frontend-body .hero h1 {
  margin-bottom: 17px;
  color: var(--front-ink);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.052em;
}

.frontend-body .hero h1 span {
  background: linear-gradient(110deg, #5556da 5%, #6b6cee 50%, #168dcc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.frontend-body .hero p {
  max-width: 580px;
  color: var(--front-muted);
  font-size: 18px;
  line-height: 1.75;
}

.frontend-body .search-container {
  max-width: 640px;
  margin-top: 30px;
}

.frontend-body .search-input {
  height: 60px;
  padding: 0 88px 0 54px;
  border: 1px solid rgba(211, 214, 227, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--front-ink);
  font-size: 15px;
  box-shadow:
    0 2px 5px rgba(16, 19, 34, 0.03),
    0 12px 35px rgba(42, 47, 79, 0.08);
}

.frontend-body .search-input::placeholder {
  color: #9ca3b2;
}

.frontend-body .search-input:focus {
  border-color: rgba(91, 92, 226, 0.65);
  box-shadow:
    0 0 0 4px rgba(91, 92, 226, 0.11),
    0 15px 40px rgba(42, 47, 79, 0.1);
}

.frontend-body .search-icon {
  left: 20px;
  color: #848b9e;
}

.frontend-body .search-shortcut {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 1px solid var(--front-line);
  border-radius: 8px;
  background: #f8f9fc;
  color: #858c9d;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.frontend-body .hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  color: #858c9d;
  font-size: 12px;
}

.frontend-body .hero-stats strong {
  color: var(--front-ink);
  font-size: 13px;
  font-weight: 700;
}

.frontend-body .hero-stats i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c3c7d2;
}

.frontend-body .category-shell {
  display: flex;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 26px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--front-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 18px rgba(16, 19, 34, 0.035);
}

.frontend-body .category-shell-label {
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid var(--front-line);
  color: #858c9d;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.frontend-body .categories-bar {
  max-width: none;
  margin: 0;
  padding: 0 0 0 12px;
  gap: 6px;
}

.frontend-body .category-chip {
  min-height: 38px;
  padding: 8px 13px;
  border-color: transparent;
  background: transparent;
  color: var(--front-muted);
  font-size: 13px;
  font-weight: 560;
}

.frontend-body .category-chip:hover {
  border-color: transparent;
  background: #f2f3f7;
  color: var(--front-ink);
}

.frontend-body .category-chip.active {
  border-color: transparent;
  background: var(--front-ink);
  color: #fff;
  box-shadow: 0 5px 12px rgba(16, 19, 34, 0.16);
}

.frontend-body .apps-section {
  max-width: 1180px;
  padding: 18px 0 58px;
}

.frontend-body #featuredSection {
  padding-top: 10px;
  padding-bottom: 50px;
}

.frontend-body .section-title {
  justify-content: space-between;
  margin-bottom: 20px;
  color: var(--front-ink);
}

.frontend-body .section-title-main {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.028em;
}

.frontend-body .section-title-main > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.frontend-body .section-title-main small {
  display: block;
  color: #999fb0;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1;
}

.frontend-body .section-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e6e7ef;
  border-radius: 12px;
  background: #fff;
  color: var(--front-accent);
  box-shadow: 0 4px 12px rgba(16, 19, 34, 0.04);
}

.frontend-body .section-title-icon svg {
  width: 18px;
  height: 18px;
}

.frontend-body .featured-title-icon {
  border-color: rgba(91, 92, 226, 0.16);
  background: var(--front-accent-soft);
  color: var(--front-accent);
}

.frontend-body .section-title .title-badge {
  padding: 6px 10px;
  border: 1px solid var(--front-line);
  background: #fff;
  color: #858c9d;
  font-size: 11px;
  font-weight: 550;
}

.frontend-body .section-title .title-badge strong {
  color: var(--front-ink);
  font-size: 12px;
}

.frontend-body .apps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.frontend-body .app-card {
  min-height: 228px;
  padding: 20px;
  border: 1px solid var(--front-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(16, 19, 34, 0.025);
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.frontend-body .app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 92, 226, 0.2);
  box-shadow:
    0 2px 6px rgba(16, 19, 34, 0.03),
    0 18px 38px rgba(39, 43, 75, 0.1);
}

.frontend-body .app-card-header {
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.frontend-body .app-icon {
  width: 48px;
  height: 48px;
  padding: 9px;
  border-radius: 14px;
}

.frontend-body .app-icon img {
  border-radius: 6px;
}

.frontend-body .app-name {
  color: var(--front-ink);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.frontend-body .app-category {
  margin-top: 4px;
  color: #8b92a3;
  font-size: 11px;
  font-weight: 550;
}

.frontend-body .app-description {
  color: var(--front-muted);
  font-size: 13px;
  line-height: 1.68;
}

.frontend-body .app-card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top-color: #eef0f4;
}

.frontend-body .app-url {
  color: #9ba1b0;
  font-size: 10px;
}

.frontend-body .app-open {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--front-accent-soft);
  color: var(--front-accent-deep);
  font-size: 0;
  justify-content: center;
  transition: all 0.2s ease;
}

.frontend-body .app-card:hover .app-open {
  background: var(--front-accent);
  color: #fff;
}

.frontend-body .app-featured-badge {
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border: 1px solid rgba(91, 92, 226, 0.13);
  background: #f1f1ff;
  color: var(--front-accent-deep);
  box-shadow: none;
}

.frontend-body .app-featured-badge svg {
  fill: var(--front-accent);
  stroke: var(--front-accent);
}

.frontend-body .empty-state {
  color: var(--front-subtle);
}

.frontend-body .site-footer {
  margin-top: 24px;
  padding: 0;
  border-top: 1px solid var(--front-line);
  background: #ffffff;
}

.frontend-body .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  min-height: 86px;
  margin: 0 auto;
  padding: 0 24px;
}

.frontend-body .footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--front-ink);
  font-size: 13px;
  font-weight: 650;
}

.frontend-body .footer-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--front-ink);
  color: #fff;
}

.frontend-body .footer-mark svg {
  width: 14px;
  height: 14px;
}

.frontend-body .footer-inner p {
  color: #8d94a5;
  font-size: 12px;
}

@media (max-width: 1228px) {
  .frontend-body .hero,
  .frontend-body .category-shell,
  .frontend-body .apps-section {
    margin-left: 24px;
    margin-right: 24px;
  }
}

@media (max-width: 1024px) {
  .frontend-body .apps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .frontend-body .hero {
    min-height: 400px;
    padding-top: 62px;
  }
}

@media (max-width: 834px) {
  .frontend-body .hero {
    margin-top: 18px;
    border-radius: 26px;
  }

  .frontend-body .apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frontend-body .category-shell {
    display: block;
    padding: 10px;
  }

  .frontend-body .category-shell-label {
    display: none;
  }

  .frontend-body .categories-bar {
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .frontend-body .header-inner {
    height: 62px;
    padding: 0 18px;
  }

  .frontend-body .hero,
  .frontend-body .category-shell,
  .frontend-body .apps-section {
    margin-left: 14px;
    margin-right: 14px;
  }

  .frontend-body .hero {
    min-height: 360px;
    padding: 46px 20px 38px;
    border-radius: 22px;
  }

  .frontend-body .hero h1 {
    font-size: 36px;
  }

  .frontend-body .hero p {
    font-size: 15px;
    line-height: 1.65;
  }

  .frontend-body .search-input {
    height: 54px;
    padding-right: 54px;
    border-radius: 14px;
  }

  .frontend-body .search-shortcut {
    width: 30px;
    overflow: hidden;
    padding: 5px 8px;
    font-size: 0;
  }

  .frontend-body .search-shortcut::after {
    content: "↵";
    font-size: 12px;
  }

  .frontend-body .category-shell {
    margin-bottom: 18px;
    border-radius: 14px;
  }

  .frontend-body .apps-section {
    padding: 12px 0 42px;
  }

  .frontend-body .section-title-main {
    font-size: 20px;
  }

  .frontend-body .app-card {
    min-height: 218px;
  }

  .frontend-body .footer-inner {
    min-height: 92px;
    padding: 20px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .frontend-body .admin-link {
    width: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .frontend-body .admin-link svg {
    width: 17px;
    height: 17px;
  }

  .frontend-body .hero {
    min-height: 340px;
    padding: 38px 18px 32px;
  }

  .frontend-body .hero-kicker {
    margin-bottom: 18px;
  }

  .frontend-body .hero h1 {
    font-size: 32px;
  }

  .frontend-body .hero-stats {
    gap: 10px;
  }

  .frontend-body .apps-grid {
    grid-template-columns: 1fr;
  }

  .frontend-body .app-card {
    min-height: 205px;
  }
}
