/* ── Bottom navigation ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--phone-w);
  display: flex;
  background: rgba(13, 13, 26, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-sub);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.18s ease;
  gap: 3px;
}

.nav-item.active {
  color: var(--purple);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* Submit wrap lifted above bottom nav */
.submit-wrap--with-nav {
  bottom: 56px !important;
}

/* ── Login page ────────────────────────────────────────────── */
.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 60px 24px 40px;
  gap: 0;
}

.login-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding-bottom: 40px;
}

.login-logo {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
}

.login-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.login-card {
  background: var(--card);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-lg);
  padding: 28px 24px;
}

.login-card-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-card-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
}

.login-field {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-sub);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.login-field:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.phone-prefix {
  padding: 14px 12px 14px 16px;
  font-size: 15px;
  color: var(--text-muted);
  border-right: 1px solid var(--border-sub);
  flex-shrink: 0;
  user-select: none;
}

.phone-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.phone-input::placeholder {
  color: var(--text-dim);
}

.btn-login {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--r);
  background: var(--grad);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
  transition: all 0.2s ease;
}

.btn-login:active {
  transform: scale(0.98);
}

/* ── Home page ─────────────────────────────────────────────── */
.home-header {
  padding: 28px 0 20px;
}

.function-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.function-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border-sub);
  border-radius: var(--r);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s ease;
}

.function-card:hover,
.function-card:active {
  border-color: rgba(139, 92, 246, 0.4);
  background: var(--card-hover);
  transform: translateY(-1px);
}

.func-icon {
  font-size: 32px;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 14px;
}

.func-info {
  flex: 1;
  min-width: 0;
}

.func-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
}

.func-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.func-arrow {
  font-size: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* ── Mine page ─────────────────────────────────────────────── */
.mine-header {
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mine-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 4px;
}

.mine-phone {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.mine-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-logout {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border-sub);
  border-radius: 100px;
  padding: 7px 18px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-logout:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-item {
  display: block;
  text-decoration: none;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border-sub);
  transition: transform 0.18s ease;
}

.gallery-item:active {
  transform: scale(0.97);
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-label {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.gallery-func {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-time {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Image upload zone ─────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-sub);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
  background: var(--card);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone.drag-over {
  border-color: var(--purple);
  background: rgba(139, 92, 246, 0.06);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  width: 100%;
}

.upload-icon {
  font-size: 32px;
}

.upload-text {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  position: relative;
  width: 100%;
}

.upload-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── PWA install banner ────────────────────────────────────── */
.pwa-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 100%;
  max-width: var(--phone-w);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 500;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pwa-banner--visible {
  transform: translateX(-50%) translateY(0);
}

.pwa-banner-text {
  flex: 1;
  line-height: 1.4;
}

.pwa-banner-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Mobile safety ─────────────────────────────────────────── */
@media (max-width: 390px) {
  .bottom-nav {
    max-width: 100%;
  }
  .pwa-banner {
    max-width: 100%;
  }
}
