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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
  min-height: 100vh;
}

.hidden { display: none !important; }

.view { min-height: 100vh; }

/* ===== 登录/绑定卡片 ===== */
.login-card, .bind-card {
  max-width: 420px;
  margin: 15vh auto 0;
  background: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
}

.login-card h1 { font-size: 32px; margin-bottom: 8px; }
.login-card .sub, .bind-card .sub { color: #999; font-size: 14px; margin-bottom: 28px; }

.bind-card h2 { margin-bottom: 8px; }
.bind-card label { display: block; text-align: left; font-size: 13px; color: #888; margin: 16px 0 6px; }
.bind-card input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  border: 1px solid #ddd; border-radius: 8px; outline: none;
}
.bind-card input:focus { border-color: #4a90d9; }

/* ===== 按钮 ===== */
.btn { border: none; cursor: pointer; font-size: 15px; border-radius: 8px; padding: 12px 20px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #4a90d9, #357abd); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: #888; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  background: #fff; padding: 14px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
.filters { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.chip {
  border: 1px solid #ddd; background: #fff; color: #666;
  padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer;
}
.chip-active { background: #4a90d9; border-color: #4a90d9; color: #fff; }

/* ===== 任务列表 ===== */
main { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.task-card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  margin-bottom: 12px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform 0.1s;
}
.task-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.task-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.task-title { font-size: 16px; font-weight: 600; }
.task-meta { font-size: 13px; color: #999; margin-bottom: 8px; display: flex; gap: 16px; }
.task-foot { font-size: 13px; color: #999; display: flex; justify-content: space-between; }

/* ===== 标签 ===== */
.tag { font-size: 12px; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.tag-pending { background: #fff3e0; color: #e65100; }
.tag-in_progress { background: #e3f2fd; color: #1565c0; }
.tag-completed { background: #e8f5e9; color: #2e7d32; }
.tag-approved { background: #e8f5e9; color: #2e7d32; }
.tag-cancelled { background: #eee; color: #888; }
.tag-rejected { background: #fce4ec; color: #c62828; }

/* ===== 详情 ===== */
#task-detail { background: #fff; border-radius: 10px; padding: 24px; }
#task-detail h2 { margin: 12px 0; font-size: 22px; }
#task-detail h3 { margin: 20px 0 10px; font-size: 15px; color: #555; }
.detail-meta { display: flex; gap: 16px; align-items: center; font-size: 13px; color: #999; }
.desc { margin: 12px 0; font-size: 14px; line-height: 1.6; color: #444; }
.links { margin: 12px 0; font-size: 13px; }
.links a { color: #4a90d9; }
.progress-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px;
}
.remark { width: 100%; color: #888; font-size: 13px; margin-top: 4px; }
#submit-remark {
  width: 100%; padding: 10px; font-size: 14px;
  border: 1px solid #ddd; border-radius: 8px; resize: vertical; margin-bottom: 12px;
}

/* ===== 状态提示 ===== */
.loading, .empty { text-align: center; color: #999; padding: 60px 0; font-size: 14px; }
.msg { font-size: 13px; color: #4a90d9; margin-top: 12px; min-height: 18px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff;
  padding: 10px 20px; border-radius: 20px; font-size: 14px; z-index: 99;
}

/* ===== 移动端适配（≤600px） ===== */
@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  .brand { flex: 1; }

  /* 筛选栏独占第二行，横向滚动 */
  .filters {
    order: 3;
    flex: 0 0 100%;   /* 覆盖基础 flex:1，占满整行强制换行 */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    /* 隐藏滚动条但保留滚动 */
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }

  .chip {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 12px;
  }

  /* 主区域收紧 */
  main { margin: 16px auto; padding: 0 12px; }

  /* 登录/绑定卡片适配小屏 */
  .login-card, .bind-card { margin-top: 10vh; padding: 32px 20px; }

  /* 任务卡片文字微调 */
  .task-title { font-size: 15px; }
  .task-meta { gap: 10px; flex-wrap: wrap; }
}

/* ===== 设置页 ===== */
#settings { background: #fff; border-radius: 10px; padding: 24px; }
#settings h2 { margin-bottom: 16px; font-size: 20px; }
.settings-card {
  border: 1px solid #eee; border-radius: 10px;
  padding: 16px 20px; margin-bottom: 12px;
}
.settings-row { display: flex; justify-content: space-between; align-items: center; }
.settings-title { font-size: 15px; font-weight: 600; color: #333; }
.settings-desc { font-size: 13px; color: #999; margin-top: 4px; }

/* ===== 危险按钮 ===== */
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { opacity: 0.9; }

/* ===== 确认弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 99;
}
.modal-card {
  background: #fff; border-radius: 12px; padding: 28px 24px;
  width: 90%; max-width: 320px; text-align: center;
}
.modal-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; }
.modal-desc { font-size: 13px; color: #888; margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; }
