
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}

.site-header-inner {
  max-width: 540px;
  margin: 0 auto;
  min-height: 60px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.header-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.header-greeting {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-username {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
}

.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
  min-height: 36px;
}

.balance-pill:hover, .balance-pill:active {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.balance-pill-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}

.bottom-nav-inner {
  max-width: 540px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px);
  gap: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 2px 4px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color 0.18s ease, transform 0.15s ease;
  min-height: 48px;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: stroke 0.18s ease, transform 0.18s ease;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  transition: font-weight 0.18s ease, color 0.18s ease;
}

.nav-item.nav-home .nav-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.nav-item.nav-home.active .nav-icon-wrap {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.nav-item.nav-home.active svg {
  stroke: #ffffff;
}

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

.nav-item.active .nav-label {
  font-weight: 800;
  color: var(--primary);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.nav-item.nav-home::after {
  display: none;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.card-elevated {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.015em;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  min-height: 68px;
}

.task-card:hover {
  border-color: var(--border-focus);
}

.task-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  overflow: hidden;
  color: var(--primary);
}

.task-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

.task-icon-wrap svg {
  width: 22px;
  height: 22px;
}

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

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

.task-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-reward-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--success-text);
  background: var(--success-light);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

.task-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-task-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 8px 14px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(24, 119, 242, 0.25);
  white-space: nowrap;
}

.btn-task-open:hover, .btn-task-open:active {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-task-verify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.btn-task-completed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 8px 12px;
  background: var(--success-light);
  color: var(--success-text);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease;
  user-select: none;
}

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

.btn-primary {
  background: var(--primary-btn-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn-ghost {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-elevated);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

.btn-block {
  width: 100%;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--text);
}

.form-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  line-height: 1.45;
}

.alert-success {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-subtle);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-danger  { background: var(--danger-light); color: var(--danger-text); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  max-width: 440px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 360px) {
  .site-header-inner { padding-left: 10px; padding-right: 10px; }
  .main-content { padding-left: 10px; padding-right: 10px; }
  .task-card { padding: 10px 8px; gap: 8px; }
  .task-icon-wrap { width: 38px; height: 38px; }
  .task-title { font-size: 0.88rem; }
  .btn-task-open { padding: 6px 10px; font-size: 0.78rem; min-height: 32px; }
  .btn-task-verify { padding: 6px 8px; font-size: 0.78rem; min-height: 32px; }
  .nav-label { font-size: 0.68rem; }
  .balance-pill { padding: 4px 8px; font-size: 0.78rem; min-height: 32px; }
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
}

.btn-task-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 850;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-task-action:active {
  transform: scale(0.97);
}

.btn-task-action.ready-to-verify {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.38);
  animation: pulseVerify 1.8s infinite;
}

@keyframes pulseVerify {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.btn-task-completed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 36px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  cursor: default;
}

.ad-watching-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ad-watching-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.ad-watching-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border: 4px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: adSpin 0.9s linear infinite;
}

@keyframes adSpin {
  to { transform: rotate(360deg); }
}

.ad-watching-title {
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ad-watching-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.ad-watching-timer {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 900;
  font-size: 0.88rem;
}

.withdraw-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.withdraw-modal-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
