/* Worker H5 Mobile Styles */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

/* Toast Notifications */
.kk-toast {
  position: fixed;
  top: 52px;
  left: 12px;
  right: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  animation: kk-toast-in 0.3s ease;
}
@keyframes kk-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kk-toast-success {
  background: #edf9ee;
  color: #2d8c3c;
  border: 1px solid #c3e6c7;
}
.kk-toast-danger {
  background: #fef0f0;
  color: #d63939;
  border: 1px solid #f5c6c6;
}
.kk-toast-warning {
  background: #fef8e8;
  color: #c68a07;
  border: 1px solid #f5e0a0;
}

/* Auth Page Flash Messages */
.kk-auth-flash {
  margin: 0 0 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  animation: kk-toast-in 0.3s ease;
}
.kk-auth-flash-danger,
.kk-auth-flash-error {
  background: #fef0f0;
  color: #d63939;
  border: 1px solid #f5c6c6;
}
.kk-auth-flash-success {
  background: #edf9ee;
  color: #2d8c3c;
  border: 1px solid #c3e6c7;
}
.kk-auth-flash-warning {
  background: #fef8e8;
  color: #c68a07;
  border: 1px solid #f5e0a0;
}
.kk-auth-flash-info {
  background: #eef6ff;
  color: #3b82f6;
  border: 1px solid #bdd7ff;
}

/* WeUI Button Theme Overrides — Orange (#FF6B35) */
.weui-btn_primary {
  background-color: #FF6B35 !important;
}
.weui-btn_primary:not(.weui-btn_disabled):active {
  background-color: #e55a28 !important;
}
.weui-btn_primary.weui-btn_loading .weui-loading {
  color: #fff;
}
.weui-btn_primary.weui-btn_disabled {
  background-color: #FFB899 !important;
  color: rgba(255,255,255,0.7) !important;
}
.weui-btn_mini.weui-btn_primary {
  background-color: #FF6B35 !important;
}
.weui-btn_mini.weui-btn_primary:not(.weui-btn_disabled):active {
  background-color: #e55a28 !important;
}

/* WeUI Default (outlined) button — orange border/text */
.weui-btn_default {
  color: #FF6B35 !important;
  border-color: #FF6B35 !important;
}
.weui-btn_default:not(.weui-btn_disabled):active {
  color: #e55a28 !important;
  border-color: #e55a28 !important;
  background-color: rgba(255,107,53,0.06) !important;
}
.weui-btn_default.weui-btn_disabled {
  color: #FFB899 !important;
  border-color: #FFB899 !important;
}

/* WeUI link color overrides */
.weui-cells__tips a,
.weui-cell_link .weui-cell__bd {
  color: #FF6B35;
}

/* WeUI switch override */
.weui-switch:checked {
  border-color: #FF6B35 !important;
  background-color: #FF6B35 !important;
}

/* WeUI Button sizing — H5 full width */
.page-worker .weui-btn,
.worker-auth-form .weui-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.page-worker .weui-btn + .weui-btn,
.worker-auth-form .weui-btn + .weui-btn {
  margin-top: 12px;
}
/* Keep mini buttons compact when inline */
.page-worker .weui-btn_mini {
  display: inline-block;
  width: auto;
  min-width: 100px;
}

/* Search Bar */
.search-bar {
  padding: 10px 12px 0;
  background: #f5f5f5;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 20px;
  padding: 0 12px;
  height: 36px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.search-icon {
  flex-shrink: 0;
  color: #999;
  margin-right: 8px;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: #333;
  line-height: 36px;
}
.search-input::placeholder {
  color: #bbb;
}
.search-clear {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  font-size: 16px;
  color: #999;
  background: #eee;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 6px;
}

/* Platform Filter Tabs */
.platform-tabs {
  display: flex;
  padding: 10px 12px 4px;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #f5f5f5;
}
.platform-tabs::-webkit-scrollbar {
  display: none;
}
.platform-tab {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: 13px;
  color: #666;
  background: #fff;
  border-radius: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid #e8e8e8;
}
.platform-tab.active {
  color: #fff;
  background: #FF6B35;
  border-color: #FF6B35;
}
.platform-tab:active {
  opacity: 0.8;
}

/* Page Structure */
.page-worker {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f5f5f5;
}

.worker-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: white;
  padding: 12px 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.worker-header-back {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border-radius: 50%;
  transition: background 0.2s;
}
.worker-header-back:active {
  background: rgba(255,255,255,0.15);
}
.worker-header-back svg {
  display: block;
}
.worker-header-title {
  font-size: 17px;
  font-weight: 600;
}

.worker-content {
  flex: 1;
  padding-bottom: 60px;
  overflow-y: auto;
}

/* Bottom Tab Bar */
.worker-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  display: flex;
  border-top: 1px solid #e5e5e5;
  z-index: 100;
}
.worker-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #999;
  font-size: 11px;
  gap: 2px;
}
.worker-tabbar-item svg {
  width: 22px;
  height: 22px;
}
.worker-tabbar-item.active {
  color: #FF6B35;
}
.worker-tabbar-item.active svg {
  stroke: #FF6B35;
}

/* Auth Pages */
.worker-auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #FF6B35 0%, #FF8C42 40%, #f5f5f5 40%);
}
.worker-auth-header {
  text-align: center;
  padding: 50px 20px 30px;
  color: white;
}
.worker-auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}
.worker-auth-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}
.worker-auth-form {
  margin: 0 16px;
  background: white;
  border-radius: 12px;
  padding: 20px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Banner Swiper */
.banner-swiper {
  position: relative;
  overflow: hidden;
  background: #eee;
}
.swiper-track {
  display: flex;
  will-change: transform;
}
.swiper-track.animating {
  transition: transform 0.4s ease;
}
.swiper-slide {
  flex: 0 0 100%;
  width: 100%;
}
.swiper-slide img {
  display: block;
  width: 100%;
  height: 40vw;
  object-fit: cover;
}
.swiper-slide a { display: block; }
.swiper-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.swiper-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.2s, width 0.2s;
}
.swiper-dot.active {
  width: 16px;
  border-radius: 3px;
  background: #fff;
}

/* Marquee Bar */
.marquee-bar {
  display: flex;
  align-items: center;
  background: #fffaf5;
  padding: 8px 12px;
  gap: 8px;
  border-bottom: 1px solid #ffecd6;
}
.marquee-icon {
  flex-shrink: 0;
  color: #FF6B35;
}
.marquee-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.marquee-content {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee-scroll 20s linear infinite;
}
.marquee-item {
  font-size: 13px;
  color: #666;
  padding-right: 60px;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Task Cards */
.task-list {
  padding: 12px;
}
.task-card {
  display: block;
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.task-card-platform {
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}
.task-card-level {
  font-size: 12px;
  color: #999;
}
.task-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.4;
}
.task-card-desc {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
  line-height: 1.4;
}
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.task-card-reward {
  color: #FF6B35;
  font-weight: 700;
  font-size: 16px;
}
.task-card-remain, .task-card-date {
  font-size: 12px;
  color: #999;
}

/* Task Detail */
.task-detail {
  padding: 0 0 20px;
}
.task-detail-header {
  background: white;
  padding: 16px;
}
.task-detail-header h2 {
  font-size: 20px;
  margin: 0 0 10px;
  line-height: 1.4;
}
.task-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge-platform, .badge-level, .badge-deadline {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
}
.task-detail-reward {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: white;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.reward-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 8px;
}
.reward-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.reward-icon svg {
  stroke: #fff;
}
.reward-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.reward-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.reward-unit {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
}
.reward-divider {
  width: 1px;
  height: 60px;
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.task-detail-body {
  background: white;
  padding: 16px;
  margin-top: 10px;
}
.task-detail-body h3 {
  font-size: 15px;
  margin: 0 0 10px;
}
.task-description {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  word-break: break-word;
  overflow: hidden;
}
.task-description img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin: 8px 0;
}
.task-description p {
  margin: 0 0 8px;
}
.task-description p:last-child {
  margin-bottom: 0;
}
.task-merchant {
  font-size: 13px;
  color: #999;
  margin-top: 12px;
}
.task-detail-action {
  padding: 16px;
}
.task-detail-status, .task-detail-submit, .task-detail-submitted, .task-detail-approved {
  background: white;
  padding: 16px;
  margin-top: 10px;
}
.reject-reason {
  background: #fff3f3;
  color: #d63939;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}
.submission-content {
  background: #f7f7f7;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
  overflow: hidden;
}
.submission-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin: 8px 0;
}
.submission-content p {
  margin: 0 0 8px;
}
.submission-content p:last-child {
  margin-bottom: 0;
}

/* Status Badges */
.status-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.status-claimed { background: #e3f2fd; color: #1976d2; }
.status-submitted { background: #fff3e0; color: #f57c00; }
.status-approved { background: #e8f5e9; color: #388e3c; }
.status-rejected { background: #fce4ec; color: #d32f2f; }
.status-terminated { background: #f5f5f5; color: #616161; }

/* Status Filter */
.status-filter {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  white-space: nowrap;
}
.filter-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  color: #666;
  background: #f0f0f0;
}
.filter-tag.active {
  background: #FF6B35;
  color: white;
}

/* Wallet */
.wallet-card {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  color: white;
  border-radius: 12px;
  padding: 24px;
  margin: 16px;
}
.wallet-balance-label {
  font-size: 13px;
  opacity: 0.9;
}
.wallet-balance-amount {
  font-size: 36px;
  font-weight: 700;
  margin: 4px 0;
}
.wallet-frozen {
  font-size: 13px;
  opacity: 0.8;
}
.wallet-withdraw-btn {
  display: block;
  margin-top: 16px;
  padding: 8px 0;
  text-align: center;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.5);
}
.wallet-withdraw-btn:active {
  background: rgba(255,255,255,0.35);
}

/* Balance Flow */
.flow-list { padding: 0 12px; }
.flow-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px 14px;
  margin-bottom: 1px;
}
.flow-type { font-size: 14px; font-weight: 500; color: #333; }
.flow-remark { font-size: 12px; color: #999; margin-top: 2px; }
.flow-time { font-size: 11px; color: #bbb; margin-top: 2px; }
.flow-amount { font-size: 16px; font-weight: 600; white-space: nowrap; }
.flow-amount.positive { color: #2fb344; }
.flow-amount.negative { color: #d63939; }

/* Withdrawal Records */
.wd-record-list { padding: 0 12px; }
.wd-record-item {
  background: white;
  padding: 12px 14px;
  margin-bottom: 1px;
}
.wd-record-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wd-record-amount {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.wd-record-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.wd-badge-pending { background: #fff3e0; color: #e65100; }
.wd-badge-approved { background: #e3f2fd; color: #1565c0; }
.wd-badge-paid { background: #e8f5e9; color: #2e7d32; }
.wd-badge-rejected { background: #fce4ec; color: #c62828; }
.wd-badge-failed { background: #fce4ec; color: #c62828; }
.wd-record-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}
.wd-record-reason {
  font-size: 12px;
  color: #d63939;
  margin-top: 6px;
  padding: 6px 8px;
  background: #fef0f0;
  border-radius: 4px;
}

/* Profile */
.profile-header {
  background: linear-gradient(135deg, #FF6B35, #FF8C42);
  padding: 30px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-level { margin-top: 4px; }
.level-badge {
  background: rgba(255,255,255,0.3);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
}
.credit-score {
  font-size: 12px;
  opacity: 0.8;
  margin-left: 8px;
}

/* Invite */
.invite-page { padding: 16px; }
.invite-header {
  text-align: center;
  padding: 20px 0;
}
.invite-header h2 {
  font-size: 20px;
  color: #FF6B35;
  margin: 0 0 8px;
}
.invite-header p { color: #666; font-size: 14px; margin: 0; }
.invite-code-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  margin: 16px 0;
}
.invite-code-label { font-size: 13px; color: #999; }
.invite-code-value {
  font-size: 28px;
  font-weight: 700;
  color: #FF6B35;
  letter-spacing: 4px;
  margin: 8px 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
